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
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.
11 define i32 @main() nounwind {
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_ADD
18 call void asm sideeffect "a:\0Ab:\0A.dword b-a", ""()