brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.4 KiB · 68d60be Raw
117 lines · plain
1# RUN: llvm-mc -triple riscv32 -mattr=-relax -M no-aliases < %s \2# RUN:     | FileCheck -check-prefix=CHECK-INST %s3# RUN: llvm-mc -filetype=obj -triple riscv32 < %s \4# RUN:     | llvm-readobj -r - | FileCheck -check-prefix=CHECK-RELOC %s5# RUN: llvm-mc -triple riscv32 -filetype=obj < %s \6# RUN:     | llvm-objdump --no-print-imm-hex --triple=riscv32 --mattr=+c -d - \7# RUN:     | FileCheck -check-prefixes=CHECK-BYTES,CHECK-ALIAS %s8 9# RUN: llvm-mc -triple riscv64 -mattr=-relax -M no-aliases < %s \10# RUN:     | FileCheck -check-prefix=CHECK-INST %s11# RUN: llvm-mc -filetype=obj -triple riscv64 < %s \12# RUN:     | llvm-readobj -r - | FileCheck -check-prefix=CHECK-RELOC %s13# RUN: llvm-mc -triple riscv64 -filetype=obj < %s \14# RUN:     | llvm-objdump --no-print-imm-hex --triple=riscv64 --mattr=+c -d - \15# RUN:     | FileCheck -check-prefixes=CHECK-BYTES,CHECK-ALIAS %s16 17# Test the operation of the push and pop assembler directives when18# using .option relax and .option rvc. Checks that using .option pop19# correctly restores all target features to their state at the point20# where .option pop was last used.21 22# CHECK-INST: call foo23# CHECK-RELOC: R_RISCV_CALL_PLT foo 0x024# CHECK-RELOC-NOT: R_RISCV_RELAX - 0x025call foo26 27# CHECK-INST: addi s0, sp, 102028# CHECK-BYTES: 3fc1041329# CHECK-ALIAS: addi s0, sp, 102030addi s0, sp, 102031 32.option push    # Push relax=false, rvc=false33# CHECK-INST: .option push34 35.option relax36# CHECK-INST: .option relax37# CHECK-INST: call bar38# CHECK-RELOC-NEXT: R_RISCV_CALL_PLT bar 0x039# CHECK-RELOC-NEXT: R_RISCV_RELAX - 0x040call bar41 42.option push    # Push relax=true, rvc=false43# CHECK-INST: .option push44 45.option rvc46# CHECK-INST: .option rvc47# CHECK-INST: c.addi4spn s0, sp, 102048# CHECK-BYTES: 1fe049# CHECK-ALIAS: addi s0, sp, 102050addi s0, sp, 102051 52.option pop     # Pop relax=true, rvc=false53# CHECK-INST: .option pop54# CHECK-INST: addi s0, sp, 102055# CHECK-BYTES: 3fc1041356# CHECK-ALIAS: addi s0, sp, 102057addi s0, sp, 102058 59# CHECK-INST: call bar60# CHECK-RELOC-NEXT: R_RISCV_CALL_PLT bar 0x061# CHECK-RELOC-NEXT: R_RISCV_RELAX - 0x062call bar63 64.option pop     # Pop relax=false, rvc=false65# CHECK-INST: .option pop66# CHECK-INST: call baz67# CHECK-RELOC: R_RISCV_CALL_PLT baz 0x068# CHECK-RELOC-NOT: R_RISCV_RELAX - 0x069call baz70 71# CHECK-INST: addi s0, sp, 102072# CHECK-BYTES: 3fc1041373# CHECK-ALIAS: addi s0, sp, 102074addi s0, sp, 102075 76.option push    # Push pic=false77# CHECK-INST: .option push78 79.option pic80# CHECK-INST: .option pic81 82la s0, symbol83# CHECK-INST: auipc	s0, %got_pcrel_hi(symbol)84# CHECK-INST: l{{[wd]}}	s0, %pcrel_lo(.Lpcrel_hi0)(s0)85# CHECK-RELOC: R_RISCV_GOT_HI20 symbol 0x086# CHECK-RELOC: R_RISCV_PCREL_LO12_I .Lpcrel_hi0 0x087 88.option push    # Push pic=true89# CHECK-INST: .option push90 91.option nopic92# CHECK-INST: .option nopic93 94la s0, symbol95# CHECK-INST: auipc	s0, %pcrel_hi(symbol)96# CHECK-INST: addi	s0, s0, %pcrel_lo(.Lpcrel_hi1)97# CHECK-RELOC: R_RISCV_PCREL_HI20 symbol 0x098# CHECK-RELOC: R_RISCV_PCREL_LO12_I .Lpcrel_hi1 0x099 100.option pop    # Push pic=true101# CHECK-INST: .option pop102 103la s0, symbol104# CHECK-INST: auipc	s0, %got_pcrel_hi(symbol)105# CHECK-INST: l{{[wd]}}	s0, %pcrel_lo(.Lpcrel_hi2)(s0)106# CHECK-RELOC: R_RISCV_GOT_HI20 symbol 0x0107# CHECK-RELOC: R_RISCV_PCREL_LO12_I .Lpcrel_hi2 0x0108 109.option pop    # Push pic=false110# CHECK-INST: .option pop111 112la s0, symbol113# CHECK-INST: auipc	s0, %pcrel_hi(symbol)114# CHECK-INST: addi	s0, s0, %pcrel_lo(.Lpcrel_hi3)115# CHECK-RELOC: R_RISCV_PCREL_HI20 symbol 0x0116# CHECK-RELOC: R_RISCV_PCREL_LO12_I .Lpcrel_hi3 0x0117