diff options
| author | Adrian Prantl <aprantl@apple.com> | 2016-01-19 23:42:44 +0000 |
|---|---|---|
| committer | Adrian Prantl <aprantl@apple.com> | 2016-01-19 23:42:44 +0000 |
| commit | cd975018feb88d2ae9f83b712b1d3684985df0f3 (patch) | |
| tree | 52651c3767ecc3ccac0b62691be131dbfefa1fd8 /clang/test/Modules | |
| parent | 6f630f800beee0653ae7d7bf28d2ea2b145aeb04 (diff) | |
| download | bcm5719-llvm-cd975018feb88d2ae9f83b712b1d3684985df0f3.tar.gz bcm5719-llvm-cd975018feb88d2ae9f83b712b1d3684985df0f3.zip | |
Module Debugging: Make sure that anonymous tag decls that define global
variables are visited.
This shouldn't encourage anyone to put global variables into clang modules.
rdar://problem/24199640
llvm-svn: 258250
Diffstat (limited to 'clang/test/Modules')
| -rw-r--r-- | clang/test/Modules/ExtDebugInfo.cpp | 4 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/DebugCXX.h | 4 | ||||
| -rw-r--r-- | clang/test/Modules/ModuleDebugInfo.cpp | 16 |
3 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/Modules/ExtDebugInfo.cpp b/clang/test/Modules/ExtDebugInfo.cpp index b0bca88b89e..6c5bd559fc9 100644 --- a/clang/test/Modules/ExtDebugInfo.cpp +++ b/clang/test/Modules/ExtDebugInfo.cpp @@ -39,6 +39,10 @@ TypedefUnion tdu; TypedefEnum tde; TypedefStruct tds; +void foo() { + GlobalStruct.i = GlobalUnion.i = GlobalEnum; +} + // CHECK: ![[NS:.*]] = !DINamespace(name: "DebugCXX", scope: ![[MOD:[0-9]+]], // CHECK: ![[MOD]] = !DIModule(scope: null, name: {{.*}}DebugCXX diff --git a/clang/test/Modules/Inputs/DebugCXX.h b/clang/test/Modules/Inputs/DebugCXX.h index 285e094171c..cd2b7a67498 100644 --- a/clang/test/Modules/Inputs/DebugCXX.h +++ b/clang/test/Modules/Inputs/DebugCXX.h @@ -62,3 +62,7 @@ struct PureForwardDecl; typedef union { int i; } TypedefUnion; typedef enum { e0 = 0 } TypedefEnum; typedef struct { int i; } TypedefStruct; + +union { int i; } GlobalUnion; +struct { int i; } GlobalStruct; +enum { e5 = 5 } GlobalEnum; diff --git a/clang/test/Modules/ModuleDebugInfo.cpp b/clang/test/Modules/ModuleDebugInfo.cpp index c1248fd4d8e..1f574568b6f 100644 --- a/clang/test/Modules/ModuleDebugInfo.cpp +++ b/clang/test/Modules/ModuleDebugInfo.cpp @@ -30,8 +30,18 @@ // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, // CHECK-SAME-NOT: name: + +// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, +// CHECK-SAME-NOT: name: + +// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, +// CHECK-SAME-NOT: name: // CHECK-SAME: identifier: "_ZTS11TypedefEnum") +// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, +// CHECK-SAME-NOT: name: +// CHECK: !DIEnumerator(name: "e5", value: 5) + // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Struct" // CHECK-SAME: identifier: "_ZTSN8DebugCXX6StructE") @@ -65,4 +75,10 @@ // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B", // no mangled name here yet. +// CHECK: !DICompositeType(tag: DW_TAG_union_type, +// CHECK-SAME-NOT: name: + +// CHECK: !DICompositeType(tag: DW_TAG_structure_type, +// CHECK-SAME-NOT: name: + // CHECK-NEG-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "PureForwardDecl" |

