summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-06-28 22:22:47 +0000
committerDevang Patel <dpatel@apple.com>2010-06-28 22:22:47 +0000
commit9b93b6b49a406bbeec364408e115c671098f3944 (patch)
treefb81e892886cdf7bd75cba7f26b60fd42e29947d /test
parent85dfca616a76eaca8fc7845e71fdc1394e18d63f (diff)
downloadllvm-9b93b6b49a406bbeec364408e115c671098f3944.tar.gz
llvm-9b93b6b49a406bbeec364408e115c671098f3944.tar.bz2
llvm-9b93b6b49a406bbeec364408e115c671098f3944.tar.xz
Use DW_FORM_addr for DW_AT_entry_pc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107085 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/FrontendC/2010-06-28-DbgEntryPC.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/FrontendC/2010-06-28-DbgEntryPC.c b/test/FrontendC/2010-06-28-DbgEntryPC.c
new file mode 100644
index 0000000000..9ce236425a
--- /dev/null
+++ b/test/FrontendC/2010-06-28-DbgEntryPC.c
@@ -0,0 +1,48 @@
+// RUN: %llvmgcc -S -O2 -g %s -o - | llc -O2 | FileCheck %s
+// Use DW_FORM_addr for DW_AT_entry_pc.
+// Radar 8094785
+
+// CHECK: .byte 17 ## DW_TAG_compile_unit
+// CHECK-NEXT: .byte 1 ## DW_CHILDREN_yes
+// CHECK-NEXT: .byte 37 ## DW_AT_producer
+// CHECK-NEXT: .byte 8 ## DW_FORM_string
+// CHECK-NEXT: .byte 19 ## DW_AT_language
+// CHECK-NEXT: .byte 11 ## DW_FORM_data1
+// CHECK-NEXT: .byte 3 ## DW_AT_name
+// CHECK-NEXT: .byte 8 ## DW_FORM_string
+// CHECK-NEXT: .byte 82 ## DW_AT_entry_pc
+// CHECK-NEXT: .byte 1 ## DW_FORM_addr
+// CHECK-NEXT: .byte 16 ## DW_AT_stmt_list
+// CHECK-NEXT: .byte 6 ## DW_FORM_data4
+// CHECK-NEXT: .byte 27 ## DW_AT_comp_dir
+// CHECK-NEXT: .byte 8 ## DW_FORM_string
+// CHECK-NEXT: .byte 225 ## DW_AT_APPLE_optimized
+
+struct a {
+ int c;
+ struct a *d;
+};
+
+int ret;
+
+void foo(int x) __attribute__((noinline));
+void *bar(struct a *b) __attribute__((noinline));
+
+void foo(int x)
+{
+ ret = x;
+}
+
+void *bar(struct a *b) {
+ foo(b->c);
+ return b;
+}
+
+int main(int argc, char *argv[]) {
+ struct a e;
+ e.c = 4;
+ e.d = &e;
+
+ (void)bar(&e);
+ return ret;
+}