summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2015-08-07 15:14:13 +0000
committerFrederic Riss <friss@apple.com>2015-08-07 15:14:13 +0000
commita5e1453ac3cd622fe0431d2a1f4477a83843139e (patch)
tree9cd1d878ea342a645e8463162b013ffac765c97b /llvm/test
parenta5ab8443c122b6e1832e7cf6fbc8d33b8e031038 (diff)
downloadbcm5719-llvm-a5e1453ac3cd622fe0431d2a1f4477a83843139e.tar.gz
bcm5719-llvm-a5e1453ac3cd622fe0431d2a1f4477a83843139e.zip
[dsymutil] Use the new MCDwarfLineTableParams customization to emit linetables
llvm-dsymutil has to be able to process debug info produced by other compilers which use different line table settings. The testcase wasn't generated by another compiler, but by a modified clang. llvm-svn: 244319
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/tools/dsymutil/Inputs/basic2-custom-linetable.macho.x86_64.obin0 -> 3144 bytes
-rw-r--r--llvm/test/tools/dsymutil/Inputs/basic2.c6
-rw-r--r--llvm/test/tools/dsymutil/X86/custom-line-table.test40
3 files changed, 46 insertions, 0 deletions
diff --git a/llvm/test/tools/dsymutil/Inputs/basic2-custom-linetable.macho.x86_64.o b/llvm/test/tools/dsymutil/Inputs/basic2-custom-linetable.macho.x86_64.o
new file mode 100644
index 00000000000..07b36a20c1d
--- /dev/null
+++ b/llvm/test/tools/dsymutil/Inputs/basic2-custom-linetable.macho.x86_64.o
Binary files differ
diff --git a/llvm/test/tools/dsymutil/Inputs/basic2.c b/llvm/test/tools/dsymutil/Inputs/basic2.c
index 13c6d07c2a0..4524e9bc6cc 100644
--- a/llvm/test/tools/dsymutil/Inputs/basic2.c
+++ b/llvm/test/tools/dsymutil/Inputs/basic2.c
@@ -20,3 +20,9 @@ int foo(int arg) {
return bar(arg+val) + inc() + baz++;
}
+/* This file was also used to create basic2-custom-linetable.macho.x86_64.o
+ with a custom clang that had different settings for the linetable
+ encoding constants: line_base == -1 and line_range == 4.
+
+ clang -c -g basic2.c -o basic2-custom-linetable.macho.x86_64.o
+*/
diff --git a/llvm/test/tools/dsymutil/X86/custom-line-table.test b/llvm/test/tools/dsymutil/X86/custom-line-table.test
new file mode 100644
index 00000000000..86fd7e29468
--- /dev/null
+++ b/llvm/test/tools/dsymutil/X86/custom-line-table.test
@@ -0,0 +1,40 @@
+# RUN: llvm-dsymutil -oso-prepend-path %p/../Inputs -y %s -f -o - | llvm-dwarfdump - -debug-dump=line | FileCheck %s
+
+# This test runs dsymutil on an object file with non-standard (as far
+# as llvm is concerned) line table settings.
+
+---
+triple: 'x86_64-apple-darwin'
+objects:
+ - filename: basic2-custom-linetable.macho.x86_64.o
+ symbols:
+ - { sym: _foo, objAddr: 0x0, binAddr: 0x1000, size: 0x12 }
+
+# CHECK: 0x0000000000001000 19 0 {{.*}} is_stmt
+# CHECK: 0x0000000000001012 20 14 {{.*}} is_stmt prologue_end
+# CHECK: 0x0000000000001015 20 18 {{.*}}
+# CHECK: 0x0000000000001017 20 17 {{.*}}
+# CHECK: 0x0000000000001019 20 10 {{.*}}
+# CHECK: 0x000000000000101e 20 25 {{.*}}
+# CHECK: 0x0000000000001026 20 23 {{.*}}
+# CHECK: 0x000000000000102b 20 36 {{.*}}
+# CHECK: 0x000000000000103c 20 31 {{.*}}
+# CHECK: 0x000000000000103e 20 3 {{.*}}
+# CHECK: 0x0000000000001046 20 3 {{.*}} end_sequence
+
+ - { sym: _inc, objAddr: 0x0, binAddr: 0x2000, size: 0x12 }
+
+# CHECK: 0x0000000000002000 14 0 {{.*}} is_stmt
+# CHECK: 0x0000000000002004 15 10 {{.*}} is_stmt prologue_end
+# CHECK: 0x0000000000002013 15 3 {{.*}}
+# CHECK: 0x0000000000002015 15 3 {{.*}} end_sequence
+
+ - { sym: _unused1, objAddr: 0x0, binAddr: 0x3000, size: 0x12 }
+
+# CHECK: 0x0000000000003000 10 0 {{.*}} is_stmt
+# CHECK: 0x0000000000003004 11 7 {{.*}} is_stmt prologue_end
+# CHECK: 0x000000000000300e 11 3 {{.*}}
+# CHECK: 0x0000000000003013 12 1 {{.*}} is_stmt
+# CHECK: 0x000000000000301c 12 1 {{.*}} is_stmt end_sequence
+...
+
OpenPOWER on IntegriCloud