summaryrefslogtreecommitdiff
path: root/test/ELF/ppc-relocs.s
diff options
context:
space:
mode:
Diffstat (limited to 'test/ELF/ppc-relocs.s')
-rw-r--r--test/ELF/ppc-relocs.s30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/ELF/ppc-relocs.s b/test/ELF/ppc-relocs.s
new file mode 100644
index 0000000000000..a70cac1615e0d
--- /dev/null
+++ b/test/ELF/ppc-relocs.s
@@ -0,0 +1,30 @@
+# RUN: llvm-mc -filetype=obj -triple=powerpc-unknown-freebsd %s -o %t
+# RUN: ld.lld %t -o %t2
+# RUN: llvm-objdump -d %t2 | FileCheck %s
+# REQUIRES: ppc
+
+.section .R_PPC_ADDR16_HA,"ax",@progbits
+.globl _start
+_start:
+ lis 4, msg@ha
+msg:
+ .string "foo"
+ len = . - msg
+
+# CHECK: Disassembly of section .R_PPC_ADDR16_HA:
+# CHECK: _start:
+# CHECK: 11000: 3c 80 00 01 lis 4, 1
+# CHECK: msg:
+# CHECK: 11004: 66 6f 6f 00 oris 15, 19, 28416
+
+.section .R_PPC_ADDR16_LO,"ax",@progbits
+ addi 4, 4, msg@l
+mystr:
+ .asciz "blah"
+ len = . - mystr
+
+# CHECK: Disassembly of section .R_PPC_ADDR16_LO:
+# CHECK: .R_PPC_ADDR16_LO:
+# CHECK: 11008: 38 84 10 04 addi 4, 4, 4100
+# CHECK: mystr:
+# CHECK: 1100c: 62 6c 61 68 ori 12, 19, 24936