File: mips-micro-thunks.s

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (66 lines) | stat: -rw-r--r-- 2,794 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# REQUIRES: mips
# Check microMIPS thunk generation.

# RUN: echo "SECTIONS { \
# RUN:         . = 0x20000;  .text ALIGN(0x100) : { *(.text) } \
# RUN:       }" > %t.script

# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
# RUN:         -mcpu=mips32r2 -mattr=micromips %s -o %t-eb.o
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
# RUN:         -position-independent -mcpu=mips32r2 -mattr=micromips \
# RUN:         %S/Inputs/mips-micro.s -o %t-eb-pic.o
# RUN: ld.lld -o %t-eb.exe -script %t.script %t-eb.o %t-eb-pic.o
# RUN: llvm-objdump --no-print-imm-hex -d --mattr=+micromips --no-show-raw-insn %t-eb.exe \
# RUN:   | FileCheck --check-prefix=R2 %s

# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
# RUN:         -mcpu=mips32r2 -mattr=micromips %s -o %t-el.o
# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
# RUN:         -position-independent -mcpu=mips32r2 -mattr=micromips \
# RUN:         %S/Inputs/mips-micro.s -o %t-el-pic.o
# RUN: ld.lld -o %t-el.exe -script %t.script %t-el.o %t-el-pic.o
# RUN: llvm-objdump --no-print-imm-hex -d --mattr=+micromips --no-show-raw-insn %t-el.exe \
# RUN:   | FileCheck --check-prefix=R2 %s

# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
# RUN:         -mcpu=mips32r6 -mattr=micromips %s -o %t-eb-r6.o
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux \
# RUN:         -position-independent -mcpu=mips32r6 -mattr=micromips \
# RUN:         %S/Inputs/mips-micro.s -o %t-eb-pic-r6.o
# RUN: ld.lld -o %t-eb-r6.exe -script %t.script %t-eb-r6.o %t-eb-pic-r6.o
# RUN: llvm-objdump --no-print-imm-hex -d --mattr=+micromips --no-show-raw-insn %t-eb-r6.exe \
# RUN:   | FileCheck --check-prefix=R6 %s

# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
# RUN:         -mcpu=mips32r6 -mattr=micromips %s -o %t-el-r6.o
# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux \
# RUN:         -position-independent -mcpu=mips32r6 -mattr=micromips \
# RUN:         %S/Inputs/mips-micro.s -o %t-el-pic-r6.o
# RUN: ld.lld -o %t-el-r6.exe -script %t.script %t-el-r6.o %t-el-pic-r6.o
# RUN: llvm-objdump --no-print-imm-hex -d --mattr=+micromips --no-show-raw-insn %t-el-r6.exe \
# RUN:   | FileCheck --check-prefix=R6 %s

# R2: <__start>:
# R2-NEXT:    20100:  jal   {{.*}} <__microLA25Thunk_foo>
# R2-NEXT:            nop

# R2: <__microLA25Thunk_foo>:
# R2-NEXT:    20108:  lui   $25, 2
# R2-NEXT:            j     {{.*}} <foo>
# R2-NEXT:            addiu $25, $25, 289
# R2-NEXT:            nop

# R6: <__start>:
# R6-NEXT:    20100:  balc  {{.*}} <__start>

# R6: <__microLA25Thunk_foo>:
# R6-NEXT:    20104:  lui   $25, 2
# R6-NEXT:            addiu $25, $25, 273
# R6-NEXT:            bc    {{.*}} <__microLA25Thunk_foo+0x8>

  .text
  .set micromips
  .global __start
__start:
  jal foo