diff options
author | Brock Wyma <brock.wyma@intel.com> | 2018-05-22 12:41:19 +0000 |
---|---|---|
committer | Brock Wyma <brock.wyma@intel.com> | 2018-05-22 12:41:19 +0000 |
commit | 8557ec5d642a86bc7d0fa3d95f5f6023a7b7cb26 (patch) | |
tree | 9faadd3f29ed7f6427e643ff94f2d4d272e4be98 /clang/test/CodeGen/debug-info-codeview-unnamed.c | |
parent | 067ec70d4fcbfc6bbb437110d94bf7e301717cd8 (diff) | |
download | bcm5719-llvm-8557ec5d642a86bc7d0fa3d95f5f6023a7b7cb26.tar.gz bcm5719-llvm-8557ec5d642a86bc7d0fa3d95f5f6023a7b7cb26.zip |
[CodeView] Enable debugging of captured variables within C++ lambdas
This change will help Visual Studio resolve forward references to C++ lambda
routines used by captured variables.
Differential Revision: https://reviews.llvm.org/D45438
llvm-svn: 332975
Diffstat (limited to 'clang/test/CodeGen/debug-info-codeview-unnamed.c')
-rw-r--r-- | clang/test/CodeGen/debug-info-codeview-unnamed.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/clang/test/CodeGen/debug-info-codeview-unnamed.c b/clang/test/CodeGen/debug-info-codeview-unnamed.c new file mode 100644 index 00000000000..bd2a7543e56 --- /dev/null +++ b/clang/test/CodeGen/debug-info-codeview-unnamed.c @@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -debug-info-kind=limited -S -emit-llvm -o - %s | FileCheck --check-prefix LINUX %s +// RUN: %clang_cc1 -triple x86_64-windows-msvc -debug-info-kind=limited -gcodeview -S -emit-llvm -o - %s | FileCheck --check-prefix MSVC %s + +int main(int argc, char* argv[], char* arge[]) { + + // In both DWARF and CodeView, an unnamed C structure type will generate a + // DICompositeType without a name or identifier attribute; + // + struct { int bar; } one = {42}; + // + // LINUX: !{{[0-9]+}} = !DILocalVariable(name: "one" + // LINUX-SAME: type: [[TYPE_OF_ONE:![0-9]+]] + // LINUX-SAME: ) + // LINUX: [[TYPE_OF_ONE]] = distinct !DICompositeType( + // LINUX-SAME: tag: DW_TAG_structure_type + // LINUX-NOT: name: + // LINUX-NOT: identifier: + // LINUX-SAME: ) + // + // MSVC: !{{[0-9]+}} = !DILocalVariable(name: "one" + // MSVC-SAME: type: [[TYPE_OF_ONE:![0-9]+]] + // MSVC-SAME: ) + // MSVC: [[TYPE_OF_ONE]] = distinct !DICompositeType + // MSVC-SAME: tag: DW_TAG_structure_type + // MSVC-NOT: name: + // MSVC-NOT: identifier: + // MSVC-SAME: ) + + return 0; +} |