[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / mips-npic-call-pic.s
blob902d5064c1d32abe4a195d134a429451796f496b
1 # REQUIRES: mips
2 # Check LA25 stubs creation. This stub code is necessary when
3 # non-PIC code calls PIC function.
5 # RUN: echo "SECTIONS { \
6 # RUN: . = 0x20000; .text ALIGN(0x100) : { *(.text) *(.text.*) } \
7 # RUN: }" > %t.script
9 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux -mcpu=mips32r2 \
10 # RUN: %p/Inputs/mips-fpic.s -o %t-fpic.o
11 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux -mcpu=mips32r2 \
12 # RUN: %p/Inputs/mips-fnpic.s -o %t-fnpic.o
13 # RUN: ld.lld -r %t-fpic.o %t-fnpic.o -o %t-sto-pic-r2.o
14 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux -mcpu=mips32r2 \
15 # RUN: %p/Inputs/mips-pic.s -o %t-pic-r2.o
16 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux -mcpu=mips32r2 \
17 # RUN: %s -o %t-npic-r2.o
18 # RUN: ld.lld %t-npic-r2.o %t-pic-r2.o %t-sto-pic-r2.o \
19 # RUN: -script %t.script -o %t-r2.exe
20 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t-r2.exe \
21 # RUN: | FileCheck --check-prefixes=CHECK,R2 %s
23 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux -mcpu=mips32r6 \
24 # RUN: %p/Inputs/mips-fpic.s -o %t-fpic.o
25 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux -mcpu=mips32r6 \
26 # RUN: %p/Inputs/mips-fnpic.s -o %t-fnpic.o
27 # RUN: ld.lld -r %t-fpic.o %t-fnpic.o -o %t-sto-pic-r6.o
28 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux -mcpu=mips32r6 \
29 # RUN: %p/Inputs/mips-pic.s -o %t-pic-r6.o
30 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux -mcpu=mips32r6 \
31 # RUN: %s -o %t-npic-r6.o
32 # RUN: ld.lld %t-npic-r6.o %t-pic-r6.o %t-sto-pic-r6.o \
33 # RUN: -script %t.script -o %t-r6.exe
34 # RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t-r6.exe \
35 # RUN: | FileCheck --check-prefixes=CHECK,R6 %s
37 # CHECK: Disassembly of section .text:
38 # CHECK-EMPTY:
39 # CHECK-NEXT: <__start>:
40 # CHECK-NEXT: 20100: jal {{.*}} <__LA25Thunk_foo1a>
41 # CHECK-NEXT: nop
42 # CHECK-NEXT: jal {{.*}} <__LA25Thunk_foo2>
43 # CHECK-NEXT: nop
44 # CHECK-NEXT: jal {{.*}} <__LA25Thunk_foo1b>
45 # CHECK-NEXT: nop
46 # CHECK-NEXT: jal {{.*}} <__LA25Thunk_foo2>
47 # CHECK-NEXT: nop
48 # CHECK-NEXT: jal {{.*}} <__LA25Thunk_fpic>
49 # CHECK-NEXT: nop
50 # CHECK-NEXT: jal {{.*}} <fnpic>
51 # CHECK-NEXT: nop
53 # CHECK: <__LA25Thunk_fpic>:
54 # R2: 20130: lui $25, 2
55 # R6: 20130: aui $25, $zero, 2
56 # CHECK-NEXT: j {{.*}} <fpic>
57 # CHECK-NEXT: addiu $25, $25, 320
58 # CHECK-NEXT: nop
60 # CHECK: <fpic>:
61 # CHECK-NEXT: 20140: nop
63 # CHECK: <fnpic>:
64 # CHECK-NEXT: 20150: nop
66 # CHECK: <__LA25Thunk_foo1a>:
67 # R2: 20154: lui $25, 2
68 # R6: 20154: aui $25, $zero, 2
69 # CHECK: j {{.*}} <foo1a>
70 # CHECK-NEXT: addiu $25, $25, 384
71 # CHECK-NEXT: nop
73 # CHECK: <__LA25Thunk_foo1b>:
74 # R2: 20164: lui $25, 2
75 # R6: aui $25, $zero, 2
76 # CHECK-NEXT: j {{.*}} <foo1b>
77 # CHECK-NEXT: addiu $25, $25, 388
78 # CHECK-NEXT: nop
80 # CHECK: <foo1a>:
81 # CHECK-NEXT: 20180: nop
83 # CHECK: <foo1b>:
84 # CHECK-NEXT: 20184: nop
86 # CHECK: <__LA25Thunk_foo2>:
87 # R2: 20188: lui $25, 2
88 # R6: aui $25, $zero, 2
89 # CHECK-NEXT: j {{.*}} <foo2>
90 # CHECK-NEXT: addiu $25, $25, 416
91 # CHECK-NEXT: nop
93 # CHECK: <foo2>:
94 # CHECK-NEXT: 201a0: nop
96 .text
97 .globl __start
98 __start:
99 jal foo1a
100 jal foo2
101 jal foo1b
102 jal foo2
103 jal fpic
104 jal fnpic