summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-04-29 16:52:31 +0000
committerAdrian Prantl <aprantl@apple.com>2015-04-29 16:52:31 +0000
commit00820abf0271dcbe03231b832d603ad6a1e7dc9b (patch)
treece6918965a5f7dc1e394f679839228646966a3e5 /clang/test
parentba6ec4b70bc49bf8b65b59f64b43df4df3fe786e (diff)
downloadbcm5719-llvm-00820abf0271dcbe03231b832d603ad6a1e7dc9b.tar.gz
bcm5719-llvm-00820abf0271dcbe03231b832d603ad6a1e7dc9b.zip
Debug Info: Represent local anonymous unions as anonymous unions
and as artificial local variables in the debug info. This is a follow-up to r236059. We can't get rid of the local variables entirely because the gdb buildbot depends on them, but we can mark them as artificial while still emitting the correct debug info. As I learned from review comments other compilers also follow this model. A paired commit in LLVM temporarily relaxes the debug info verifier to not check the integrity of DW_OP_bit_pieces of artificial variables. rdar://problem/20730771 llvm-svn: 236125
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp b/clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp
index cfc7bc8fbfe..ad3b6d4c623 100644
--- a/clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp
+++ b/clang/test/CodeGenCXX/debug-info-anon-union-vars.cpp
@@ -21,8 +21,26 @@ int test_it() {
return (c == 1);
}
+void foo() {
+ union {
+ int i;
+ char c;
+ };
+ i = 8;
+}
+
// CHECK: [[FILE:.*]] = !DIFile(filename: "{{.*}}debug-info-anon-union-vars.cpp",
// CHECK: !DIGlobalVariable(name: "c",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
// CHECK: !DIGlobalVariable(name: "d",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
// CHECK: !DIGlobalVariable(name: "a",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
// CHECK: !DIGlobalVariable(name: "b",{{.*}} file: [[FILE]], line: 6,{{.*}} isLocal: true, isDefinition: true
+// CHECK: !DILocalVariable(tag: DW_TAG_auto_variable, name: "i", {{.*}}, flags: DIFlagArtificial
+// CHECK: !DILocalVariable(tag: DW_TAG_auto_variable, name: "c", {{.*}}, flags: DIFlagArtificial
+// CHECK: !DILocalVariable(
+// CHECK-NOT: name:
+// CHECK: type: ![[UNION:[0-9]+]]
+// CHECK: ![[UNION]] = !DICompositeType(tag: DW_TAG_union_type,
+// CHECK-NOT: name:
+// CHECK: elements
+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "i", scope: ![[UNION]],
+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "c", scope: ![[UNION]],
OpenPOWER on IntegriCloud