Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / ELF / mips-micror6-relocs.s
blob90547356e7b5c7a50ad410c0a6cf88ffc67f1a8b
1 # REQUIRES: mips
3 # Check handling of microMIPS R6 relocations.
5 # RUN: echo "SECTIONS { \
6 # RUN: . = 0x20000; .text ALIGN(0x100) : { *(.text) } \
7 # RUN: }" > %t.script
9 # RUN: llvm-mc -filetype=obj -triple=mips -mcpu=mips32r6 \
10 # RUN: %S/Inputs/mips-micro.s -o %t1eb.o
11 # RUN: llvm-mc -filetype=obj -triple=mips -mcpu=mips32r6 %s -o %t2eb.o
12 # RUN: ld.lld -o %teb.exe -script %t.script %t1eb.o %t2eb.o
13 # RUN: llvm-objdump --no-print-imm-hex -d -t --mattr=micromips --no-show-raw-insn %teb.exe \
14 # RUN: | FileCheck %s
16 # RUN: llvm-mc -filetype=obj -triple=mipsel -mcpu=mips32r6 \
17 # RUN: %S/Inputs/mips-micro.s -o %t1el.o
18 # RUN: llvm-mc -filetype=obj -triple=mipsel -mcpu=mips32r6 %s -o %t2el.o
19 # RUN: ld.lld -o %tel.exe -script %t.script %t1el.o %t2el.o
20 # RUN: llvm-objdump --no-print-imm-hex -d -t --mattr=micromips --no-show-raw-insn %tel.exe \
21 # RUN: | FileCheck %s
23 # CHECK: 00020100 g F .text 00000000 0x80 foo
24 # CHECK: 00020110 g .text 00000000 0x80 __start
26 # CHECK: <__start>:
27 # CHECK-NEXT: 20110: lapc $2, -12
28 # CHECK-NEXT: beqzc $3, 0x200f0
29 # CHECK-NEXT: balc {{.*}} <foo>
31 .text
32 .set micromips
33 .global __start
34 __start:
35 addiupc $2, foo+4 # R_MICROMIPS_PC19_S2
36 beqzc $3, foo+4 # R_MICROMIPS_PC21_S1
37 balc foo+4 # R_MICROMIPS_PC26_S1