xref: /aosp_15_r20/external/llvm/test/MC/Mips/micromips-tailr.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc %s -triple=mipsel-unknown-linux -show-encoding \
2*9880d681SAndroid Build Coastguard Worker# RUN: -mattr=micromips | FileCheck %s -check-prefix=CHECK-FIXUP
3*9880d681SAndroid Build Coastguard Worker# RUN: llvm-mc %s -filetype=obj -triple=mipsel-unknown-linux \
4*9880d681SAndroid Build Coastguard Worker# RUN: -mattr=micromips | llvm-readobj -r \
5*9880d681SAndroid Build Coastguard Worker# RUN: | FileCheck %s -check-prefix=CHECK-ELF
6*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------
7*9880d681SAndroid Build Coastguard Worker# Check that the assembler can handle the documented syntax
8*9880d681SAndroid Build Coastguard Worker# for relocations.
9*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------
10*9880d681SAndroid Build Coastguard Worker# CHECK-FIXUP: foo:
11*9880d681SAndroid Build Coastguard Worker# CHECK-FIXUP:   addiu $2, $zero, 1332
12*9880d681SAndroid Build Coastguard Worker# CHECK-FIXUP:         # encoding: [0x40,0x30,0x34,0x05]
13*9880d681SAndroid Build Coastguard Worker# CHECK-FIXUP:   j foo # encoding: [A,0xd4'A',A,0b000000AA]
14*9880d681SAndroid Build Coastguard Worker# CHECK-FIXUP:         #   fixup A - offset: 0,
15*9880d681SAndroid Build Coastguard Worker# CHECK-FIXUP:             value: foo, kind: fixup_MICROMIPS_26_S1
16*9880d681SAndroid Build Coastguard Worker# CHECK-FIXUP:   nop   # encoding: [0x00,0x00,0x00,0x00]
17*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------
18*9880d681SAndroid Build Coastguard Worker# Check that the appropriate relocations were created.
19*9880d681SAndroid Build Coastguard Worker#------------------------------------------------------------------------------
20*9880d681SAndroid Build Coastguard Worker# CHECK-ELF: Relocations [
21*9880d681SAndroid Build Coastguard Worker# CHECK-ELF:     0x{{[0-9,A-F]+}} R_MICROMIPS_26_S1
22*9880d681SAndroid Build Coastguard Worker# CHECK-ELF: ]
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Workerfoo:
25*9880d681SAndroid Build Coastguard Worker  addiu $2, $0, 1332
26*9880d681SAndroid Build Coastguard Worker  j foo
27