summaryrefslogtreecommitdiffstats
path: root/lld/test/wasm/debuginfo-relocs.s
diff options
context:
space:
mode:
Diffstat (limited to 'lld/test/wasm/debuginfo-relocs.s')
-rw-r--r--lld/test/wasm/debuginfo-relocs.s23
1 files changed, 23 insertions, 0 deletions
diff --git a/lld/test/wasm/debuginfo-relocs.s b/lld/test/wasm/debuginfo-relocs.s
new file mode 100644
index 00000000000..bece55f54ff
--- /dev/null
+++ b/lld/test/wasm/debuginfo-relocs.s
@@ -0,0 +1,23 @@
+# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
+# RUN: wasm-ld %t.o -o %t.wasm
+# RUN: obj2yaml %t.wasm | FileCheck %s
+
+bar:
+ .functype bar () -> ()
+ end_function
+
+ .globl _start
+_start:
+ .functype _start () -> ()
+ call bar
+ end_function
+
+ .section .debug_info,"",@
+ .int32 bar
+
+# Even though `bar` is live in the final binary it doesn't have a table entry
+# since its not address taken in the code. In this case any relocations in the
+# debug sections see a address of zero.
+
+# CHECK: Name: .debug_info
+# CHECK-NEXT: Payload: '00000000'
OpenPOWER on IntegriCloud