[ELF] Make SyntheticSection parameter order match InputSection
[llvm-project.git] / lld / test / ELF / mips-micro-cross-calls.s
blob3e88235887535fb6c6b86b72f9d78abf3c5495cf
1 # REQUIRES: mips
2 # Check various cases of microMIPS - regular code cross-calls.
4 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
5 # RUN: -mattr=micromips %s -o %t-eb.o
6 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
7 # RUN: -position-independent -mattr=micromips \
8 # RUN: %S/Inputs/mips-micro.s -o %t-eb-pic.o
9 # RUN: ld.lld -o %t-eb.exe %t-eb.o %t-eb-pic.o
10 # RUN: llvm-objdump -d -t --mattr=-micromips \
11 # RUN: --no-show-raw-insn --print-imm-hex %t-eb.exe \
12 # RUN: | FileCheck --check-prefix=REG %s
13 # RUN: llvm-objdump -d -t --mattr=+micromips \
14 # RUN: --no-show-raw-insn --print-imm-hex %t-eb.exe \
15 # RUN: | FileCheck --check-prefix=MICRO %s
17 # REG: {{0*}}[[FOOT:[0-9a-f]+]] l F .text 0000000e 0x80 __microLA25Thunk_foo
18 # REG: {{0*}}[[MIC:[0-9a-f]+]] g .text 00000000 0x80 micro
19 # REG: {{0*}}[[BAR:[0-9a-f]+]] g F .text 00000000 bar
21 # REG: <__start>:
22 # REG-NEXT: jalx 0x[[MIC]] <micro>
23 # REG-NEXT: nop
24 # REG-NEXT: jalx 0x[[FOOT]] <__microLA25Thunk_foo>
26 # REG: <__LA25Thunk_bar>:
27 # REG-NEXT: lui $25, 0x2
28 # REG-NEXT: j 0x[[BAR]] <bar>
30 # MICRO: {{0*}}[[BART:[0-9a-f]+]] l F .text 00000010 __LA25Thunk_bar
31 # MICRO: {{0*}}[[START:[0-9a-f]+]] g .text 00000000 __start
32 # MICRO: {{0*}}[[FOO:[0-9a-f]+]] g F .text 00000000 0x80 foo
34 # MICRO: <micro>:
35 # MICRO-NEXT: jalx 0x[[START]]
36 # MICRO-NEXT: nop
37 # MICRO-NEXT: jalx 0x[[BART]]
39 # MICRO: <__microLA25Thunk_foo>:
40 # MICRO-NEXT: lui $25, 0x2
41 # MICRO-NEXT: j 0x[[FOO]] <foo>
43 .text
44 .set nomicromips
45 .global __start
46 __start:
47 jal micro
48 jal foo
50 .set micromips
51 .global micro
52 micro:
53 jal __start
54 jal bar