2 # Check microMIPS thunk generation.
4 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
5 # RUN: -mcpu=mips32r2 -mattr=micromips %s -o %t-eb.o
6 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
7 # RUN: -position-independent -mcpu=mips32r2 -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 -mattr=+micromips %t-eb.exe \
11 # RUN: | FileCheck --check-prefix=EB-R2 %s
13 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
14 # RUN: -mcpu=mips32r2 -mattr=micromips %s -o %t-el.o
15 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
16 # RUN: -position-independent -mcpu=mips32r2 -mattr=micromips \
17 # RUN: %S/Inputs/mips-micro.s -o %t-el-pic.o
18 # RUN: ld.lld -o %t-el.exe %t-el.o %t-el-pic.o
19 # RUN: llvm-objdump -d -mattr=+micromips %t-el.exe \
20 # RUN: | FileCheck --check-prefix=EL-R2 %s
22 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
23 # RUN: -mcpu=mips32r6 -mattr=micromips %s -o %t-eb-r6.o
24 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
25 # RUN: -position-independent -mcpu=mips32r6 -mattr=micromips \
26 # RUN: %S/Inputs/mips-micro.s -o %t-eb-pic-r6.o
27 # RUN: ld.lld -o %t-eb-r6.exe %t-eb-r6.o %t-eb-pic-r6.o
28 # RUN: llvm-objdump -d -mattr=+micromips %t-eb-r6.exe \
29 # RUN: | FileCheck --check-prefix=EB-R6 %s
31 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
32 # RUN: -mcpu=mips32r6 -mattr=micromips %s -o %t-el-r6.o
33 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
34 # RUN: -position-independent -mcpu=mips32r6 -mattr=micromips \
35 # RUN: %S/Inputs/mips-micro.s -o %t-el-pic-r6.o
36 # RUN: ld.lld -o %t-el-r6.exe %t-el-r6.o %t-el-pic-r6.o
37 # RUN: llvm-objdump -d -mattr=+micromips %t-el-r6.exe \
38 # RUN: | FileCheck --check-prefix=EL-R6 %s
41 # EB-R2-NEXT: 20000: f4 01 00 04 jal 131080 <__microLA25Thunk_foo>
42 # EB-R2-NEXT: 20004: 00 00 00 00 nop
44 # EB-R2: __microLA25Thunk_foo:
45 # EB-R2-NEXT: 20008: 41 b9 00 02 lui $25, 2
46 # EB-R2-NEXT: 2000c: d4 01 00 10 j 131104
47 # EB-R2-NEXT: 20010: 33 39 00 21 addiu $25, $25, 33
48 # EB-R2-NEXT: 20014: 0c 00 nop
51 # EL-R2-NEXT: 20000: 01 f4 04 00 jal 131080 <__microLA25Thunk_foo>
52 # EL-R2-NEXT: 20004: 00 00 00 00 nop
54 # EL-R2: __microLA25Thunk_foo:
55 # EL-R2-NEXT: 20008: b9 41 02 00 lui $25, 2
56 # EL-R2-NEXT: 2000c: 01 d4 10 00 j 131104
57 # EL-R2-NEXT: 20010: 39 33 21 00 addiu $25, $25, 33
58 # EL-R2-NEXT: 20014: 00 0c nop
61 # EB-R6-NEXT: 20000: b4 00 00 00 balc 0 <__start>
63 # EB-R6: __microLA25Thunk_foo:
64 # EB-R6-NEXT: 20004: 13 20 00 02 lui $25, 2
65 # EB-R6-NEXT: 20008: 33 39 00 11 addiu $25, $25, 17
66 # EB-R6-NEXT: 2000c: 94 00 00 00 bc 0 <__microLA25Thunk_foo+0x8>
69 # EL-R6-NEXT: 20000: 00 b4 00 00 balc 0 <__start>
71 # EL-R6: __microLA25Thunk_foo:
72 # EL-R6-NEXT: 20004: 20 13 02 00 lui $25, 2
73 # EL-R6-NEXT: 20008: 39 33 11 00 addiu $25, $25, 17
74 # EL-R6-NEXT: 2000c: 00 94 00 00 bc 0 <__microLA25Thunk_foo+0x8>