From 5061ecc615cd532792fde9bd0898bc8ba670680d Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 7 Jan 2015 21:10:25 +0000 Subject: [PATCH] Add a test that would have found the issue in r224935. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225385 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/MC/MachO/AArch64/reloc-crash2.s | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/MC/MachO/AArch64/reloc-crash2.s diff --git a/test/MC/MachO/AArch64/reloc-crash2.s b/test/MC/MachO/AArch64/reloc-crash2.s new file mode 100644 index 00000000000..6ae44715c63 --- /dev/null +++ b/test/MC/MachO/AArch64/reloc-crash2.s @@ -0,0 +1,24 @@ +; RUN: llvm-mc -triple arm64-apple-darwin10 %s -filetype=obj -o - | llvm-readobj -r --expand-relocs | FileCheck %s + +; This is a regression test making sure we don't crash. + +; CHECK: Relocations [ +; CHECK-NEXT: Section __text { +; CHECK-NEXT: Relocation { +; CHECK-NEXT: Offset: 0x0 +; CHECK-NEXT: PCRel: 0 +; CHECK-NEXT: Length: 2 +; CHECK-NEXT: Extern: 1 +; CHECK-NEXT: Type: ARM64_RELOC_PAGEOFF12 (4) +; CHECK-NEXT: Symbol: ltmp1 +; CHECK-NEXT: Scattered: 0 +; CHECK-NEXT: } +; CHECK-NEXT: } +; CHECK-NEXT: ] + + + ldr x0, [x8, L_bar@PAGEOFF] + + .section __foo,__bar,regular,no_dead_strip +L_bar: + .quad 0 -- 2.50.1