Add a test for checking the current .debug_frame dumping capability.
authorEli Bendersky <eliben@google.com>
Wed, 6 Feb 2013 20:55:06 +0000 (20:55 +0000)
committerEli Bendersky <eliben@google.com>
Wed, 6 Feb 2013 20:55:06 +0000 (20:55 +0000)
The test is a binary placed in test/DebugInfo/Inputs, with a source C
file used for reference/reproducing. The source's first line is a clang
build command for reproducing the binary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174543 91177308-0d34-0410-b5e6-96231b3b80d8

test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.c [new file with mode: 0644]
test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.o [new file with mode: 0644]
test/DebugInfo/dwarfdump-debug-frame-simple.test [new file with mode: 0644]

diff --git a/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.c b/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.c
new file mode 100644 (file)
index 0000000..708e037
--- /dev/null
@@ -0,0 +1,14 @@
+// clang -c -g -o dwarfdump-test-32bit.elf.o -m32 dwarfdump-test-32bit.elf.c
+
+extern int glob;
+
+int foo(int arg) {
+  int a = arg * 2;
+  return a + glob;
+}
+
+int bar(int arg) {
+  int a = foo(arg) * foo(arg * 2);
+  return glob - foo(a);
+}
+
diff --git a/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.o b/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.o
new file mode 100644 (file)
index 0000000..817665e
Binary files /dev/null and b/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.o differ
diff --git a/test/DebugInfo/dwarfdump-debug-frame-simple.test b/test/DebugInfo/dwarfdump-debug-frame-simple.test
new file mode 100644 (file)
index 0000000..65e650f
--- /dev/null
@@ -0,0 +1,14 @@
+; RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test-32bit.elf.o -debug-dump=frames | FileCheck %s -check-prefix FRAMES
+
+; FRAMES: .debug_frame
+; FRAMES-NOT: .eh_frame
+
+; FRAMES: 00000000 00000010 ffffffff CIE
+; FRAMES: Version: 1
+
+; FRAMES: 00000014 00000010 00000000 FDE cie=00000000 pc=00000000...00000022
+; FRAMES: 00000028 00000014 00000000 FDE cie=00000000 pc=00000030...00000080
+
+; FRAMES-NOT: CIE
+; FRAMES-NOT: FDE
+