summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/debug-info-same-line.c
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-02-11 17:45:15 +0000
committerAdrian Prantl <aprantl@apple.com>2015-02-11 17:45:15 +0000
commit5f66bae411272a6d4c3637a2526c817e9f43431b (patch)
treefbffbe35e5e08cda40764927cabf3526a5e48953 /clang/test/CodeGen/debug-info-same-line.c
parent18a25b016e5dcfca2d0710df5279b7aca8228bef (diff)
downloadbcm5719-llvm-5f66bae411272a6d4c3637a2526c817e9f43431b.tar.gz
bcm5719-llvm-5f66bae411272a6d4c3637a2526c817e9f43431b.zip
Fix PR19351. While building up a composite type it is important to use
a non-uniqueable temporary node that is only turned into a permanent unique or distinct node after it is finished. Otherwise an intermediate node may get accidentally uniqued with another node as illustrated by the testcase. Paired commit with LLVM. llvm-svn: 228855
Diffstat (limited to 'clang/test/CodeGen/debug-info-same-line.c')
-rw-r--r--clang/test/CodeGen/debug-info-same-line.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/CodeGen/debug-info-same-line.c b/clang/test/CodeGen/debug-info-same-line.c
new file mode 100644
index 00000000000..dddabda8695
--- /dev/null
+++ b/clang/test/CodeGen/debug-info-same-line.c
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm %s -g -o - | FileCheck %s
+// Here two temporary nodes are identical (but should not get uniqued) while
+// building the full debug type.
+typedef struct { long x; } foo; typedef struct { foo *x; } bar;
+// CHECK: [ DW_TAG_structure_type ] [line 4, size 64,
+// CHECK: [ DW_TAG_structure_type ] [line 4, size 64,
+bar b;
OpenPOWER on IntegriCloud