[VPlan] Use Operands to create VPReplicateRecipe for invar store. (NFC)
[llvm-project.git] / llvm / test / MC / LoongArch / Relocations / fixups.s
blobcdb38c09d4c0c4ef0566a7d021d7c1188e9894f6
1 # RUN: llvm-mc --triple=loongarch64 %s --show-encoding \
2 # RUN: | FileCheck --check-prefix=CHECK-FIXUP %s
3 # RUN: llvm-mc --filetype=obj --triple=loongarch64 %s \
4 # RUN: | llvm-objdump -d - | FileCheck --check-prefix=CHECK-INSTR %s
5 # RUN: llvm-mc --filetype=obj --triple=loongarch64 %s \
6 # RUN: | llvm-readobj -r - | FileCheck --check-prefix=CHECK-REL %s
8 ## Checks that fixups that can be resolved within the same object file are
9 ## applied correctly.
11 .LBB0:
12 lu12i.w $t1, %abs_hi20(val)
13 # CHECK-FIXUP: fixup A - offset: 0, value: %abs_hi20(val), kind: fixup_loongarch_abs_hi20
14 # CHECK-INSTR: lu12i.w $t1, 74565
16 ori $t1, $t1, %abs_lo12(val)
17 # CHECK-FIXUP: fixup A - offset: 0, value: %abs_lo12(val), kind: fixup_loongarch_abs_lo12
18 # CHECK-INSTR: ori $t1, $t1, 1656
20 b .LBB0
21 # CHECK-FIXUP: fixup A - offset: 0, value: .LBB0, kind: fixup_loongarch_b26
22 # CHECK-INSTR: b -8
23 b .LBB2
24 # CHECK-FIXUP: fixup A - offset: 0, value: .LBB2, kind: fixup_loongarch_b26
25 # CHECK-INSTR: b 331004
26 beq $a0, $a1, .LBB0
27 # CHECK-FIXUP: fixup A - offset: 0, value: .LBB0, kind: fixup_loongarch_b16
28 # CHECK-INSTR: beq $a0, $a1, -16
29 blt $a0, $a1, .LBB1
30 # CHECK-FIXUP: fixup A - offset: 0, value: .LBB1, kind: fixup_loongarch_b16
31 # CHECK-INSTR: blt $a0, $a1, 1116
32 beqz $a0, .LBB0
33 # CHECK-FIXUP: fixup A - offset: 0, value: .LBB0, kind: fixup_loongarch_b21
34 # CHECK-INSTR: beqz $a0, -24
35 bnez $a0, .LBB1
36 # CHECK-FIXUP: fixup A - offset: 0, value: .LBB1, kind: fixup_loongarch_b21
37 # CHECK-INSTR: bnez $a0, 1108
39 .fill 1104
41 .LBB1:
43 .fill 329876
44 nop
45 .LBB2:
47 .set val, 0x12345678
49 # CHECK-REL-NOT: R_LARCH
51 ## Testing the function call offset could resolved by assembler
52 ## when the function and the callsite within the same compile unit.
53 func:
54 .fill 100
55 bl func
56 # CHECK-FIXUP: fixup A - offset: 0, value: func, kind: fixup_loongarch_b26
57 # CHECK-INSTR: bl -100
59 .fill 10000
60 bl func
61 # CHECK-FIXUP: fixup A - offset: 0, value: func, kind: fixup_loongarch_b26
62 # CHECK-INSTR: bl -10104
64 .fill 20888
65 bl func
66 # CHECK-FIXUP: fixup A - offset: 0, value: func, kind: fixup_loongarch_b26
67 # CHECK-INSTR: bl -30996