Alex Bradbury | 9d3f125 | 2017-09-28 08:26:24 +0000 | [diff] [blame] | 1 | # RUN: llvm-mc -filetype=obj -triple=riscv32 %s \ |
| 2 | # RUN: | llvm-objdump -d - | FileCheck %s -check-prefix=CHECK-INSTR |
| 3 | |
| 4 | # RUN: llvm-mc -filetype=obj -triple=riscv32 %s \ |
| 5 | # RUN: | llvm-readobj -r | FileCheck %s -check-prefix=CHECK-REL |
| 6 | |
Alex Bradbury | 257d5b5 | 2018-05-23 12:36:18 +0000 | [diff] [blame] | 7 | # Check the assembler can handle hi and lo expressions with a constant |
| 8 | # address. Test case derived from test/MC/Mips/hilo-addressing.s |
Alex Bradbury | 9d3f125 | 2017-09-28 08:26:24 +0000 | [diff] [blame] | 9 | |
| 10 | # Check that 1 is added to the high 20 bits if bit 11 of the low part is 1. |
| 11 | .equ addr, 0xdeadbeef |
| 12 | lui t0, %hi(addr) |
| 13 | lw ra, %lo(addr)(t0) |
| 14 | # CHECK-INSTR: lui t0, 912092 |
| 15 | # CHECK-INSTR: lw ra, -273(t0) |
| 16 | |
Alex Bradbury | 9d3f125 | 2017-09-28 08:26:24 +0000 | [diff] [blame] | 17 | # CHECK-REL-NOT: R_RISCV |