2 # Check microMIPS thunk generation.
4 # RUN: echo "SECTIONS { \
5 # RUN: . = 0x20000; .text ALIGN(0x100) : { *(.text) } \
8 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
9 # RUN: -mcpu=mips32r2 -mattr=micromips %s -o %t-eb.o
10 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
11 # RUN: -position-independent -mcpu=mips32r2 -mattr=micromips \
12 # RUN: %S/Inputs/mips-micro.s -o %t-eb-pic.o
13 # RUN: ld.lld -o %t-eb.exe -script %t.script %t-eb.o %t-eb-pic.o
14 # RUN: llvm-objdump --no-print-imm-hex -d --mattr=+micromips --no-show-raw-insn %t-eb.exe \
15 # RUN: | FileCheck --check-prefix=R2 %s
17 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
18 # RUN: -mcpu=mips32r2 -mattr=micromips %s -o %t-el.o
19 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
20 # RUN: -position-independent -mcpu=mips32r2 -mattr=micromips \
21 # RUN: %S/Inputs/mips-micro.s -o %t-el-pic.o
22 # RUN: ld.lld -o %t-el.exe -script %t.script %t-el.o %t-el-pic.o
23 # RUN: llvm-objdump --no-print-imm-hex -d --mattr=+micromips --no-show-raw-insn %t-el.exe \
24 # RUN: | FileCheck --check-prefix=R2 %s
26 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
27 # RUN: -mcpu=mips32r6 -mattr=micromips %s -o %t-eb-r6.o
28 # RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
29 # RUN: -position-independent -mcpu=mips32r6 -mattr=micromips \
30 # RUN: %S/Inputs/mips-micro.s -o %t-eb-pic-r6.o
31 # RUN: ld.lld -o %t-eb-r6.exe -script %t.script %t-eb-r6.o %t-eb-pic-r6.o
32 # RUN: llvm-objdump --no-print-imm-hex -d --mattr=+micromips --no-show-raw-insn %t-eb-r6.exe \
33 # RUN: | FileCheck --check-prefix=R6 %s
35 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
36 # RUN: -mcpu=mips32r6 -mattr=micromips %s -o %t-el-r6.o
37 # RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
38 # RUN: -position-independent -mcpu=mips32r6 -mattr=micromips \
39 # RUN: %S/Inputs/mips-micro.s -o %t-el-pic-r6.o
40 # RUN: ld.lld -o %t-el-r6.exe -script %t.script %t-el-r6.o %t-el-pic-r6.o
41 # RUN: llvm-objdump --no-print-imm-hex -d --mattr=+micromips --no-show-raw-insn %t-el-r6.exe \
42 # RUN: | FileCheck --check-prefix=R6 %s
45 # R2-NEXT: 20100: jal {{.*}} <__microLA25Thunk_foo>
48 # R2: <__microLA25Thunk_foo>:
49 # R2-NEXT: 20108: lui $25, 2
50 # R2-NEXT: j {{.*}} <foo>
51 # R2-NEXT: addiu $25, $25, 289
55 # R6-NEXT: 20100: balc {{.*}} <__start>
57 # R6: <__microLA25Thunk_foo>:
58 # R6-NEXT: 20104: lui $25, 2
59 # R6-NEXT: addiu $25, $25, 273
60 # R6-NEXT: bc {{.*}} <__microLA25Thunk_foo+0x8>