Alex Bradbury | 9c03e4c | 2018-11-12 14:25:07 +0000 | [diff] [blame] | 1 | ; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=+relax %s -o - \ |
| 2 | ; RUN: | llvm-readobj -r | FileCheck -check-prefix=RELAX %s |
| 3 | ; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=-relax %s -o - \ |
| 4 | ; RUN: | llvm-readobj -r | FileCheck -check-prefix=NORELAX %s |
| 5 | |
| 6 | ; This test checks that a diff inserted via inline assembly only causes |
| 7 | ; relocations when relaxation is enabled. This isn't an assembly test |
| 8 | ; as the assembler takes a different path through LLVM, which is |
| 9 | ; already covered by the fixups-expr.s test. |
| 10 | |
| 11 | define i32 @main() { |
| 12 | entry: |
| 13 | %retval = alloca i32, align 4 |
| 14 | store i32 0, i32* %retval, align 4 |
| 15 | ; RELAX: R_RISCV_ADD64 b |
| 16 | ; RELAX: R_RISCV_SUB64 a |
| 17 | ; NORELAX-NOT: R_RISCV |
| 18 | call void asm sideeffect "a:\0Ab:\0A.dword b-a", ""() |
| 19 | ret i32 0 |
| 20 | } |