1; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=+relax %s -o - | llvm-readobj -r - | FileCheck %s
2; RUN: llc -filetype=obj -mtriple=riscv32 -mattr=-relax %s -o - | llvm-readobj -r - | FileCheck %s
3
4; This test checks that a diff inserted via inline assembly always causes
5; relocations. This isn't an assembly test as the assembler takes a different
6; path through LLVM, which is already covered by the fixups-expr.s test.
7
8define i32 @main() nounwind {
9entry:
10  %retval = alloca i32, align 4
11  store i32 0, i32* %retval, align 4
12  ; CHECK: R_RISCV_ADD64 b
13  ; CHECK-NEXT: R_RISCV_SUB64 a
14  call void asm sideeffect "a:\0Ab:\0A.dword b-a", ""()
15  ret i32 0
16}
17