summaryrefslogtreecommitdiffstats
path: root/llvm/test/ExecutionEngine
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/ExecutionEngine')
-rw-r--r--llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s30
1 files changed, 27 insertions, 3 deletions
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s
index 8a50ede9027..f050c3d846c 100644
--- a/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s
+++ b/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s
@@ -62,11 +62,26 @@ z2:
.globl abssym
abssym = 0xdeadbeef
- # Test subtractor relocations.
-# rtdyld-check: *{8}z3 = z4 - z5 + 4
-z3:
+# Test subtractor relocations between named symbols.
+# rtdyld-check: *{8}z3a = z4 - z5 + 4
+z3a:
.quad z4 - z5 + 4
+# Test subtractor relocations between anonymous symbols.
+# rtdyld-check: *{8}z3b = (section_addr(test_x86-64.o, _tmp3) + 4) - (section_addr(test_x86-64.o, _tmp4)) + 8
+z3b:
+ .quad Lanondiff_1 - Lanondiff_2 + 8
+
+# Test subtractor relocations between named and anonymous symbols.
+# rtdyld-check: *{8}z3c = z4 - (section_addr(test_x86-64.o, _tmp4)) + 12
+z3c:
+ .quad z4 - Lanondiff_2 + 12
+
+# Test subtractor relocations between anonymous and named symbols.
+# rtdyld-check: *{8}z3d = (section_addr(test_x86-64.o, _tmp3) + 4) - z4 + 16
+z3d:
+ .quad Lanondiff_1 - z4 + 16
+
.section __DATA,_tmp1
z4:
.byte 1
@@ -75,4 +90,13 @@ z4:
z5:
.byte 1
+ .section __DATA,_tmp3
+ .long 1 # padding to make sure we handle non-zero offsets.
+Lanondiff_1:
+ .byte 1
+
+ .section __DATA,_tmp4
+Lanondiff_2:
+ .byte 1
+
.subsections_via_symbols
OpenPOWER on IntegriCloud