[ELF] Refine isExported/isPreemptible condition
[llvm-project.git] / lld / test / ELF / arm-v5-reloc-error.s
blob85e66f1d3850f2b578a0531f9a1584a4e3fb8864
1 // REQUIRES: arm
2 // This test intentionally checks for fatal errors, and fatal errors aren't supported for testing when main is run twice.
3 // XFAIL: main-run-twice
4 // RUN: llvm-mc -filetype=obj -triple=armv7a-linux-gnueabi %s -o %t
5 // RUN: echo "SECTIONS { \
6 // RUN: . = SIZEOF_HEADERS; \
7 // RUN: .text_low : { *(.text_low) *(.text_low2) } \
8 // RUN: .text_high 0x2000000 : { *(.text_high) *(.text_high2) } \
9 // RUN: } " > %t.script
10 // RUN: not ld.lld --script %t.script %t -o /dev/null 2>&1 | FileCheck %s
12 // RUN: llvm-mc -filetype=obj -triple=armv7aeb-linux-gnueabi -mcpu=cortex-a8 %s -o %t
13 // RUN: not ld.lld --script %t.script %t -o /dev/null 2>&1 | FileCheck %s
14 // RUN: not ld.lld -be8 --script %t.script %t -o /dev/null 2>&1 | FileCheck %s
16 // CHECK: error: relocation R_ARM_THM_JUMP24 to far not supported for Armv5 or Armv6 targets
18 // Lie about our build attributes. Our triple is armv7a-linux-gnueabi but
19 // we are claiming to be Armv5. This can also happen with llvm-mc when we
20 // don't have any .eabi_attribute directives in the file or the
21 // --arm-add-build-attributes command line isn't used to add them from the
22 // triple.
23 .eabi_attribute 6, 5 // Tag_cpu_arch 5 = v5TEJ
24 .thumb
25 .syntax unified
26 .section .text_low, "ax", %progbits
27 .thumb
28 .globl _start
29 .type _start, %function
30 _start:
31 b.w far // Will produce relocation not supported in Armv5.
33 .section .text_high, "ax", %progbits
34 .globl far
35 .type far, %function
36 far:
37 bx lr