Skip to content

Commit 68cef49

Browse files
committed
[RISCV,test] Remove CHECK lines for MCAsmStreamer's fixup output
The fixup output is a debug aid and should not be used to test target-specific relocation generation implementation. The llvm-mc -filetype=obj output is what truly matters.
1 parent 89687e6 commit 68cef49

File tree

4 files changed

+4
-34
lines changed

4 files changed

+4
-34
lines changed
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
# RUN: llvm-mc -triple riscv32 -mattr=+c -M no-aliases < %s -show-encoding \
2-
# RUN: | FileCheck -check-prefix=INSTR -check-prefix=FIXUP %s
1+
# RUN: llvm-mc -triple riscv32 -mattr=+c -M no-aliases %s -show-encoding \
2+
# RUN: | FileCheck -check-prefix=INSTR %s
33
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+c < %s \
44
# RUN: | llvm-readobj -r - | FileCheck -check-prefix=RELOC %s
55
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+c,+relax < %s \
66
# RUN: | llvm-readobj -r - | FileCheck -check-prefix=RELOC %s
77

88
# Check prefixes:
99
# RELOC - Check the relocation in the object.
10-
# FIXUP - Check the fixup on the instruction.
1110
# INSTR - Check the instruction is handled properly by the ASMPrinter
1211
c.jal foo
1312
# A compressed jump (c.j) to an unresolved symbol will be relaxed to a (jal).
1413
# RELOC: R_RISCV_JAL
1514
# INSTR: c.jal foo
16-
# FIXUP: fixup A - offset: 0, value: foo, kind: fixup_riscv_rvc_jump
1715

1816
c.bnez a0, foo
1917
# A compressed branch (c.bnez) to an unresolved symbol will be relaxed to a (bnez).
2018
# The (bnez) to an unresolved symbol will in turn be relaxed to (beqz; jal)
21-
# RELOC: R_RISCV_JAL
19+
# RELOC-NEXT: R_RISCV_JAL
2220
# INSTR: c.bnez a0, foo
23-
# FIXUP: fixup A - offset: 0, value: foo, kind: fixup_riscv_rvc_branch

llvm/test/MC/RISCV/fixups-compressed.s

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
# RUN: llvm-mc %s -triple riscv32 -mattr=+c -show-encoding \
2-
# RUN: | FileCheck -check-prefix=CHECK-FIXUP %s
31
# RUN: llvm-mc -triple riscv32 -filetype=obj -mattr=+c < %s \
42
# RUN: | llvm-objdump -d -M no-aliases - | FileCheck --check-prefix=CHECK-INSTR %s
53
# RUN: llvm-mc -filetype=obj -mattr=+c -triple=riscv32 %s \
64
# RUN: | llvm-readobj -r - | FileCheck %s -check-prefix=CHECK-REL
75

86
.LBB0_2:
9-
# CHECK-FIXUP: fixup A - offset: 0, value: .LBB0_2, kind: fixup_riscv_rvc_jump
107
# CHECK-INSTR: c.j 0
118
c.j .LBB0_2
12-
# CHECK: fixup A - offset: 0, value: func1, kind: fixup_riscv_rvc_jump
139
# CHECK-INSTR: c.jal 0x8
1410
c.jal func1
15-
# CHECK-FIXUP: fixup A - offset: 0, value: .LBB0_2, kind: fixup_riscv_rvc_branch
1611
# CHECK-INSTR: c.beqz a3, 0x0
1712
c.beqz a3, .LBB0_2
18-
# CHECK-FIXUP: fixup A - offset: 0, value: .LBB0_2, kind: fixup_riscv_rvc_branch
1913
# CHECK-INSTR: c.bnez a5, 0x0
2014
c.bnez a5, .LBB0_2
2115

llvm/test/MC/RISCV/fixups.s

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# RUN: llvm-mc -triple riscv32 -M no-aliases < %s -show-encoding \
2-
# RUN: | FileCheck -check-prefix=CHECK-FIXUP %s
31
# RUN: llvm-mc -filetype=obj -triple riscv32 < %s \
42
# RUN: | llvm-objdump --no-print-imm-hex -M no-aliases -d - \
53
# RUN: | FileCheck -check-prefix=CHECK-INSTR %s
@@ -11,41 +9,30 @@
119

1210
.LBB0:
1311
lui t1, %hi(val)
14-
# CHECK-FIXUP: fixup A - offset: 0, value: %hi(val), kind: fixup_riscv_hi20
1512
# CHECK-INSTR: lui t1, 74565
1613

1714
lw a0, %lo(val)(t1)
18-
# CHECK-FIXUP: fixup A - offset: 0, value: %lo(val), kind: fixup_riscv_lo12_i
1915
# CHECK-INSTR: lw a0, 1656(t1)
2016
addi a1, t1, %lo(val)
21-
# CHECK-FIXUP: fixup A - offset: 0, value: %lo(val), kind: fixup_riscv_lo12_i
2217
# CHECK-INSTR: addi a1, t1, 1656
2318
sw a0, %lo(val)(t1)
24-
# CHECK-FIXUP: fixup A - offset: 0, value: %lo(val), kind: fixup_riscv_lo12_s
2519
# CHECK-INSTR: sw a0, 1656(t1)
2620

2721
1:
2822
auipc t1, %pcrel_hi(.LBB0)
29-
# CHECK-FIXUP: fixup A - offset: 0, value: %pcrel_hi(.LBB0), kind: fixup_riscv_pcrel_hi20
3023
# CHECK-INSTR: auipc t1, 0
3124
addi t1, t1, %pcrel_lo(1b)
32-
# CHECK-FIXUP: fixup A - offset: 0, value: %pcrel_lo(.Ltmp0), kind: fixup_riscv_pcrel_lo12_i
3325
# CHECK-INSTR: addi t1, t1, -16
3426
sw t1, %pcrel_lo(1b)(t1)
35-
# CHECK-FIXUP: fixup A - offset: 0, value: %pcrel_lo(.Ltmp0), kind: fixup_riscv_pcrel_lo12_s
3627
# CHECK-INSTR: sw t1, -16(t1)
3728

3829
jal zero, .LBB0
39-
# CHECK-FIXUP: fixup A - offset: 0, value: .LBB0, kind: fixup_riscv_jal
4030
# CHECK-INSTR: jal zero, 0x0
4131
jal zero, .LBB2
42-
# CHECK-FIXUP: fixup A - offset: 0, value: .LBB2, kind: fixup_riscv_jal
4332
# CHECK-INSTR: jal zero, 0x50d14
4433
beq a0, a1, .LBB0
45-
# CHECK-FIXUP: fixup A - offset: 0, value: .LBB0, kind: fixup_riscv_branch
4634
# CHECK-INSTR: beq a0, a1, 0x0
4735
blt a0, a1, .LBB1
48-
# CHECK-FIXUP: fixup A - offset: 0, value: .LBB1, kind: fixup_riscv_branch
4936
# CHECK-INSTR: blt a0, a1, 0x47c
5037

5138
.fill 1104
@@ -66,18 +53,15 @@ addi zero, zero, 0
6653
func:
6754
.fill 100
6855
call func
69-
# CHECK-FIXUP: fixup A - offset: 0, value: func, kind: fixup_riscv_call
7056
# CHECK-INSTR: auipc ra, 0
7157
# CHECK-INSTR: jalr ra, -100(ra)
7258

7359
.fill 10000
7460
call func
75-
# CHECK-FIXUP: fixup A - offset: 0, value: func, kind: fixup_riscv_call
7661
# CHECK-INSTR: auipc ra, 1048574
7762
# CHECK-INSTR: jalr ra, -1916(ra)
7863

7964
.fill 20888
8065
call func
81-
# CHECK-FIXUP: fixup A - offset: 0, value: func, kind: fixup_riscv_call
8266
# CHECK-INSTR: auipc ra, 1048568
8367
# CHECK-INSTR: jalr ra, 1764(ra)

llvm/test/MC/RISCV/xqcibi-relocations.s

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# RUN: llvm-mc -triple riscv32 -mattr=+experimental-xqcibi %s -show-encoding \
2-
# RUN: | FileCheck -check-prefix=INSTR -check-prefix=FIXUP %s
2+
# RUN: | FileCheck -check-prefix=INSTR %s
33
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+experimental-xqcibi %s -o %t.o
44
# RUN: llvm-readobj -r %t.o | FileCheck -check-prefix=RELOC %s
55

66
# Check prefixes:
77
# RELOC - Check the relocation in the object.
8-
# FIXUP - Check the fixup on the instruction.
98
# INSTR - Check the instruction is handled properly by the ASMPrinter.
109

1110
.text
@@ -14,25 +13,21 @@
1413
qc.bnei x6, 10, foo
1514
# RELOC: R_RISCV_JAL foo 0x0
1615
# INSTR: qc.bnei t1, 10, foo
17-
# FIXUP: fixup A - offset: 0, value: foo, kind: fixup_riscv_branch
1816

1917
# Since foo is undefined, this will be relaxed to (qc.e.bltui + jal)
2018
qc.e.bgeui x8, 12, foo
2119
# RELOC: R_RISCV_JAL foo 0x0
2220
# INSTR: qc.e.bgeui s0, 12, foo
23-
# FIXUP: fixup A - offset: 0, value: foo, kind: fixup_riscv_qc_e_branch
2421

2522
# Check that a label in a different section is handled similar to an undefined
2623
# symbol and gets relaxed to (qc.e.bgeui + jal)
2724
qc.e.bltui x4, 9, .bar
2825
# RELOC: R_RISCV_JAL .bar 0x0
2926
# INSTR: qc.e.bltui tp, 9, .bar
30-
# FIXUP: fixup A - offset: 0, value: .bar, kind: fixup_riscv_qc_e_branch
3127

3228
# Check that branches to a defined symbol are handled correctly
3329
qc.e.beqi x7, 8, .L1
3430
# INSTR: qc.e.beqi t2, 8, .L1
35-
# FIXUP: fixup A - offset: 0, value: .L1, kind: fixup_riscv_qc_e_branch
3631

3732
.L1:
3833
ret

0 commit comments

Comments
 (0)