2 # Check LA25 stubs creation with caller in different Output Section to callee.
3 # This stub code is necessary when non-PIC code calls PIC function.
5 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
6 # RUN: %p/Inputs/mips-fpic.s -o %t-fpic.o
7 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
8 # RUN: %p/Inputs/mips-fnpic.s -o %t-fnpic.o
9 # RUN: ld.lld -r %t-fpic.o %t-fnpic.o -o %t-sto-pic.o
10 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
11 # RUN: %p/Inputs/mips-pic.s -o %t-pic.o
12 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t-npic.o
13 # RUN: ld.lld %t-npic.o %t-pic.o %t-sto-pic.o -o %t.exe
14 # RUN: llvm-objdump -d --no-show-raw-insn --print-imm-hex %t.exe | FileCheck %s
16 # CHECK: Disassembly of section .text:
18 # CHECK-NEXT: <__LA25Thunk_foo1a>:
19 # CHECK-NEXT: lui $25, 0x2
20 # CHECK-NEXT: j {{.*}} <foo1a>
21 # CHECK-NEXT: addiu $25, $25, {{.*}}
23 # CHECK: <__LA25Thunk_foo1b>:
24 # CHECK-NEXT: lui $25, 0x2
25 # CHECK-NEXT: j {{.*}} <foo1b>
26 # CHECK-NEXT: addiu $25, $25, {{.*}}
34 # CHECK: <__LA25Thunk_foo2>:
35 # CHECK-NEXT: lui $25, 0x2
36 # CHECK-NEXT: j {{.*}} <foo2>
37 # CHECK-NEXT: addiu $25, $25, {{.*}}
42 # CHECK: <__LA25Thunk_fpic>:
43 # CHECK-NEXT: lui $25, 0x2
44 # CHECK-NEXT: j {{.*}} <fpic>
45 # CHECK-NEXT: addiu $25, $25, {{.*}}
53 # CHECK-NEXT: Disassembly of section .differentos:
55 # CHECK-NEXT: <__start>:
56 # CHECK-NEXT: jal {{.*}} <__LA25Thunk_foo1a>
58 # CHECK-NEXT: jal {{.*}} <__LA25Thunk_foo2>
60 # CHECK-NEXT: jal {{.*}} <__LA25Thunk_foo1b>
62 # CHECK-NEXT: jal {{.*}} <__LA25Thunk_foo2>
64 # CHECK-NEXT: jal {{.*}} <__LA25Thunk_fpic>
66 # CHECK-NEXT: jal {{.*}} <fnpic>
68 .section .differentos, "ax", %progbits