summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-06-28 18:25:03 +0000
committerDevang Patel <dpatel@apple.com>2010-06-28 18:25:03 +0000
commit4a1cad673c5bf0812099c6c8f551fe6af967c2b3 (patch)
tree410d267eac0a5f7a528f52c769fffad1895c608d /test
parent3d895b974d01f2c562a869921274f1198e29ff87 (diff)
downloadllvm-4a1cad673c5bf0812099c6c8f551fe6af967c2b3.tar.gz
llvm-4a1cad673c5bf0812099c6c8f551fe6af967c2b3.tar.bz2
llvm-4a1cad673c5bf0812099c6c8f551fe6af967c2b3.tar.xz
Preserve deleted function's local variables' debug info.
Radar 8122864. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107027 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/FrontendC/2010-06-28-DbgLocalVar.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/FrontendC/2010-06-28-DbgLocalVar.c b/test/FrontendC/2010-06-28-DbgLocalVar.c
new file mode 100644
index 0000000000..e5df8856c0
--- /dev/null
+++ b/test/FrontendC/2010-06-28-DbgLocalVar.c
@@ -0,0 +1,14 @@
+// RUN: %llvmgcc -S -O2 -g %s -o - | llc -O2 -o %t.s
+// RUN: grep DW_TAG_structure_type %t.s | count 2
+// Radar 8122864
+
+// Code is not generated for function foo, but preserve type information of
+// local variable xyz.
+static foo() {
+ struct X { int a; int b; } xyz;
+}
+
+int bar() {
+ foo();
+ return 1;
+}