# RUN: llvm-mc -filetype=obj -triple=powerpc64le-unknown-linux %s -o %t
# RUN: ld.lld %t -o %t2
-# RUN: llvm-objdump -D %t2 | FileCheck %s --check-prefix=rodataLE
+# RUN: llvm-objdump -D %t2 | FileCheck %s --check-prefix=DATALE
# RUN: llvm-objdump -D %t2 | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple=powerpc64-unknown-linux %s -o %t
# RUN: ld.lld %t -o %t2
-# RUN: llvm-objdump -D %t2 | FileCheck %s --check-prefix=rodataBE
+# RUN: llvm-objdump -D %t2 | FileCheck %s --check-prefix=DATABE
# RUN: llvm-objdump -D %t2 | FileCheck %s
.text
.LBB0_2:
add 3, 3, 4
-# rodataLE: Disassembly of section .rodata:
-# rodataLE: .rodata:
-# rodataLE: 10000190: b4 fe 00 00
+# DATALE: Disassembly of section .rodata:
+# DATALE: .rodata:
+# DATALE: 10000190: b4 fe 00 00
-# rodataBE: Disassembly of section .rodata:
-# rodataBE: .rodata:
-# rodataBE: 10000190: 00 00 fe b4
+# DATABE: Disassembly of section .rodata:
+# DATABE: .rodata:
+# DATABE: 10000190: 00 00 fe b4
# Address of rodata + value stored at rodata entry
# should equal address of LBB0_2.
# CHECK: 1001003c: {{.*}} addis 5, 2, -1
# CHECK: 10010040: {{.*}} ld 5, -32736(5)
# CHECK: 10010044: {{.*}} add 3, 3, 4
+
+.section .R_PPC64_REL64, "ax",@progbits
+.globl .FR_PPC64_REL64
+.FR_PPC64_REL64:
+ .cfi_startproc
+ .cfi_personality 148, __foo
+ li 0, 1
+ li 3, 55
+ sc
+ .cfi_endproc
+__foo:
+ li 3,0
+
+# Check that address of eh_frame entry + value stored
+# should equal the address of foo. Since it is not aligned,
+# the entry is not stored exactly at 100001a8. It starts at
+# address 0x100001aa and has the value 0xfeaa.
+# 0x100001aa + 0xfeaa = 0x10010054
+# DATALE: Disassembly of section .eh_frame:
+# DATALE: .eh_frame:
+# DATALE: 100001a8: {{.*}} aa fe
+
+# DATABE: Disassembly of section .eh_frame:
+# DATABE: .eh_frame:
+# DATABE: 100001b0: fe aa {{.*}}
+
+# CHECK: __foo
+# CHECK-NEXT: 10010054: {{.*}} li 3, 0