From 4a1cad673c5bf0812099c6c8f551fe6af967c2b3 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Mon, 28 Jun 2010 18:25:03 +0000 Subject: 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 --- test/FrontendC/2010-06-28-DbgLocalVar.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/FrontendC/2010-06-28-DbgLocalVar.c (limited to 'test/FrontendC') diff --git a/test/FrontendC/2010-06-28-DbgLocalVar.c b/test/FrontendC/2010-06-28-DbgLocalVar.c new file mode 100644 index 0000000..e5df8856 --- /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; +} -- cgit v1.1