summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2014-06-12 18:52:35 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2014-06-12 18:52:35 +0000
commitf0e4034c425dd947f5373a29ebbf8b8912da01e8 (patch)
tree6b742c14d14df0c73a12917da016ec3690adb279 /llvm/test
parent6823a0b6781b92861ce5c83aed696b2c71979d3c (diff)
downloadbcm5719-llvm-f0e4034c425dd947f5373a29ebbf8b8912da01e8.tar.gz
bcm5719-llvm-f0e4034c425dd947f5373a29ebbf8b8912da01e8.zip
[llvm-symbolizer] Fix parsing DW_AT_ranges in Fission skeleton compile unit DIEs.
Turns out that DW_AT_ranges_base attribute sets the offset for DW_AT_ranges values specified in the .dwo file, but not for DW_AT_ranges specified in the skeleton compile unit DIE in the main executable. This is extremely confusing, and would hopefully be fixed in DWARF-5 when it's finalized. For now this behavior makes sense, as otherwise Fission would break DWARF consumers who doesn't know anything about DW_AT_ranges_base. llvm-svn: 210809
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/DebugInfo/Inputs/fission-ranges.cc17
-rwxr-xr-xllvm/test/DebugInfo/Inputs/fission-ranges.elf-x86_64bin0 -> 8693 bytes
-rw-r--r--llvm/test/DebugInfo/llvm-symbolizer.test4
3 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/DebugInfo/Inputs/fission-ranges.cc b/llvm/test/DebugInfo/Inputs/fission-ranges.cc
new file mode 100644
index 00000000000..a585bf9c008
--- /dev/null
+++ b/llvm/test/DebugInfo/Inputs/fission-ranges.cc
@@ -0,0 +1,17 @@
+static inline int inlined_f() {
+ volatile int x = 2;
+ return x;
+}
+
+int main() {
+ return inlined_f();
+}
+
+// Build instructions:
+// $ mkdir /tmp/dbginfo
+// $ cp fission-ranges.cc /tmp/dbginfo/
+// $ cd /tmp/dbginfo
+// $ gcc -gsplit-dwarf -O2 -fPIC fission-ranges.cc -c -o obj2.o
+// $ clang -gsplit-dwarf -O2 -fsanitize=address -fPIC -Dmain=foo fission-ranges.cc -c -o obj1.o
+// $ gcc obj1.o obj2.o -shared -o <output>
+// $ objcopy --remove-section=.debug_aranges <output>
diff --git a/llvm/test/DebugInfo/Inputs/fission-ranges.elf-x86_64 b/llvm/test/DebugInfo/Inputs/fission-ranges.elf-x86_64
new file mode 100755
index 00000000000..3d2fd79dd74
--- /dev/null
+++ b/llvm/test/DebugInfo/Inputs/fission-ranges.elf-x86_64
Binary files differ
diff --git a/llvm/test/DebugInfo/llvm-symbolizer.test b/llvm/test/DebugInfo/llvm-symbolizer.test
index 6aa12876fa5..1ddfd9cf55c 100644
--- a/llvm/test/DebugInfo/llvm-symbolizer.test
+++ b/llvm/test/DebugInfo/llvm-symbolizer.test
@@ -17,6 +17,7 @@ RUN: echo "%p/Inputs/macho-universal 0x1f84" >> %t.input
RUN: echo "%p/Inputs/macho-universal:i386 0x1f67" >> %t.input
RUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t.input
RUN: echo "%p/Inputs/llvm-symbolizer-dwo-test 0x400514" >> %t.input
+RUN: echo "%p/Inputs/fission-ranges.elf-x86_64 0x720" >> %t.input
RUN: llvm-symbolizer --functions=linkage --inlining --demangle=false \
RUN: --default-arch=i386 < %t.input | FileCheck %s
@@ -90,6 +91,9 @@ CHECK: _Z3inci
CHECK: main
CHECK-NEXT: llvm-symbolizer-dwo-test.cc:11
+CHECK: main
+CHECK-NEXT: {{.*}}fission-ranges.cc:6
+
RUN: echo "unexisting-file 0x1234" > %t.input2
RUN: llvm-symbolizer < %t.input2
OpenPOWER on IntegriCloud