[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / arm-thumb-interwork-ifunc.s
blob2c8908518ce5eeb087980366a019a43cc25ada13
1 // REQUIRES: arm
2 // RUN: llvm-mc --triple=armv7a-linux-gnueabihf -arm-add-build-attributes -filetype=obj -o %t.o %s
3 // RUN: ld.lld %t.o -o %t
4 // RUN: llvm-objdump --no-print-imm-hex --triple=armv7a-none-linux-gnueabi -d --no-show-raw-insn %t | FileCheck %s
6 /// A symbol assignment defined alias inherits st_type and gets the same treatment.
7 // RUN: llvm-mc --triple=armv7a-linux-gnueabihf -arm-add-build-attributes -filetype=obj --defsym ALIAS=1 -o %t1.o %s
8 // RUN: ld.lld --defsym foo=foo1 %t1.o -o %t1
9 // RUN: llvm-objdump --no-print-imm-hex --triple=armv7a-none-linux-gnueabi -d --no-show-raw-insn %t | FileCheck %s
11 /// Non-preemptible ifuncs are called via a PLT entry which is always Arm
12 /// state, expect the ARM callers to go direct to the PLT entry, Thumb
13 /// branches are indirected via state change thunks, the bl is changed to blx.
15 .syntax unified
16 .text
17 .balign 0x1000
18 .ifdef ALIAS
19 .type foo1 STT_GNU_IFUNC
20 .globl foo1
21 foo1:
22 .else
23 .type foo STT_GNU_IFUNC
24 .globl foo
25 foo:
26 .endif
27 bx lr
29 .section .text.1, "ax", %progbits
30 .arm
31 .global _start
32 _start:
33 b foo
34 bl foo
36 .section .text.2, "ax", %progbits
37 .thumb
38 .global thumb_caller
39 thumb_caller:
40 b foo
41 b.w foo
42 bl foo
44 // CHECK: 00021004 <_start>:
45 // CHECK-NEXT: b 0x21030
46 // CHECK-NEXT: bl 0x21030
48 // CHECK: 0002100c <thumb_caller>:
49 // CHECK-NEXT: b.w 0x21018 <__Thumbv7ABSLongThunk_foo>
50 // CHECK-NEXT: b.w 0x21018 <__Thumbv7ABSLongThunk_foo>
51 // CHECK-NEXT: blx 0x21030
53 // CHECK: 00021018 <__Thumbv7ABSLongThunk_foo>:
54 // CHECK-NEXT: movw r12, #4144
55 // CHECK-NEXT: movt r12, #2
56 // CHECK-NEXT: bx r12
58 // CHECK: Disassembly of section .iplt:
60 // CHECK: 00021030 <.iplt>:
61 // CHECK-NEXT: add r12, pc, #0, #12
62 // CHECK-NEXT: add r12, r12, #16, #20
63 // CHECK-NEXT: ldr pc, [r12, #8]!