Skip to content

Commit 144fa44

Browse files
committed
Make use of normalized filecheck directives
Since revisions are now always passed as `CHECK-{rev.to_uppercase()}`, update test cases to use this format. There were also some test files that used uppercase names, presumably so the directives would match filecheck. Normalize these revision names to lowercase. Lastly, remove use of invalid labels (such as `FIXME-CHECK:`) to skip filecheck directives. (`COM: CHECK ...` is the syntax for a comment). The below query can be used to ensure that there are no missing directives: rg --pcre2 '^\s*//\s*(?!(CHECK|COM))\S*:(?!(//|:))' \ tests/codegen tests/assembly/ tests/mir-opt/ (Note that the above may report some non-filecheck FIXMEs and other comments).
1 parent 73ec736 commit 144fa44

File tree

98 files changed

+2107
-2061
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2107
-2061
lines changed

tests/assembly/asm/arm-types.rs

+209-209
Large diffs are not rendered by default.

tests/assembly/asm/mips-types.rs

+28-28
Original file line numberDiff line numberDiff line change
@@ -70,44 +70,44 @@ macro_rules! check_reg { ($func:ident, $ty:ty, $reg:tt, $mov:literal) => {
7070
}
7171
};}
7272

73-
// mips32-LABEL: sym_static_32:
74-
// mips32: #APP
75-
// mips32: lw $3, %got(extern_static)($gp)
76-
// mips32: #NO_APP
73+
// CHECK-MIPS32-LABEL: sym_static_32:
74+
// CHECK-MIPS32: #APP
75+
// CHECK-MIPS32: lw $3, %got(extern_static)($gp)
76+
// CHECK-MIPS32: #NO_APP
7777
#[cfg(mips32)]
7878
#[no_mangle]
7979
pub unsafe fn sym_static_32() {
8080
asm!("lw $v1, {}", sym extern_static);
8181
}
8282

83-
// mips32-LABEL: sym_fn_32:
84-
// mips32: #APP
85-
// mips32: lw $3, %got(extern_func)($gp)
86-
// mips32: #NO_APP
83+
// CHECK-MIPS32-LABEL: sym_fn_32:
84+
// CHECK-MIPS32: #APP
85+
// CHECK-MIPS32: lw $3, %got(extern_func)($gp)
86+
// CHECK-MIPS32: #NO_APP
8787
#[cfg(mips32)]
8888
#[no_mangle]
8989
pub unsafe fn sym_fn_32() {
9090
asm!("lw $v1, {}", sym extern_func);
9191
}
9292

93-
// mips64-LABEL: sym_static_64:
94-
// mips64: #APP
95-
// mips64: lui $3, %got_hi(extern_static)
96-
// mips64: daddu $3, $3, $gp
97-
// mips64: ld $3, %got_lo(extern_static)($3)
98-
// mips64: #NO_APP
93+
// CHECK-MIPS64-LABEL: sym_static_64:
94+
// CHECK-MIPS64: #APP
95+
// CHECK-MIPS64: lui $3, %got_hi(extern_static)
96+
// CHECK-MIPS64: daddu $3, $3, $gp
97+
// CHECK-MIPS64: ld $3, %got_lo(extern_static)($3)
98+
// CHECK-MIPS64: #NO_APP
9999
#[cfg(mips64)]
100100
#[no_mangle]
101101
pub unsafe fn sym_static_64() {
102102
asm!("ld $v1, {}", sym extern_static);
103103
}
104104

105-
// mips64-LABEL: sym_fn_64:
106-
// mips64: #APP
107-
// mips64: lui $3, %got_hi(extern_func)
108-
// mips64: daddu $3, $3, $gp
109-
// mips64: ld $3, %got_lo(extern_func)($3)
110-
// mips64: #NO_APP
105+
// CHECK-MIPS64-LABEL: sym_fn_64:
106+
// CHECK-MIPS64: #APP
107+
// CHECK-MIPS64: lui $3, %got_hi(extern_func)
108+
// CHECK-MIPS64: daddu $3, $3, $gp
109+
// CHECK-MIPS64: ld $3, %got_lo(extern_func)($3)
110+
// CHECK-MIPS64: #NO_APP
111111
#[cfg(mips64)]
112112
#[no_mangle]
113113
pub unsafe fn sym_fn_64() {
@@ -172,10 +172,10 @@ check!(reg_i32, i32, reg, "move");
172172
// CHECK: #NO_APP
173173
check!(reg_f32_soft, f32, reg, "move");
174174

175-
// mips64-LABEL: reg_f64_soft:
176-
// mips64: #APP
177-
// mips64: move ${{[0-9]+}}, ${{[0-9]+}}
178-
// mips64: #NO_APP
175+
// CHECK-MIPS64-LABEL: reg_f64_soft:
176+
// CHECK-MIPS64: #APP
177+
// CHECK-MIPS64: move ${{[0-9]+}}, ${{[0-9]+}}
178+
// CHECK-MIPS64: #NO_APP
179179
#[cfg(mips64)]
180180
check!(reg_f64_soft, f64, reg, "move");
181181

@@ -197,10 +197,10 @@ check!(reg_u8, u8, reg, "move");
197197
// CHECK: #NO_APP
198198
check!(reg_i16, i16, reg, "move");
199199

200-
// mips64-LABEL: reg_i64:
201-
// mips64: #APP
202-
// mips64: move ${{[0-9]+}}, ${{[0-9]+}}
203-
// mips64: #NO_APP
200+
// CHECK-MIPS64-LABEL: reg_i64:
201+
// CHECK-MIPS64: #APP
202+
// CHECK-MIPS64: move ${{[0-9]+}}, ${{[0-9]+}}
203+
// CHECK-MIPS64: #NO_APP
204204
#[cfg(mips64)]
205205
check!(reg_i64, i64, reg, "move");
206206

tests/assembly/asm/powerpc-types.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ check!(reg_i16, i16, reg, "mr");
8888
// CHECK: #NO_APP
8989
check!(reg_i32, i32, reg, "mr");
9090

91-
// powerpc64-LABEL: reg_i64:
92-
// powerpc64: #APP
93-
// powerpc64: mr {{[0-9]+}}, {{[0-9]+}}
94-
// powerpc64: #NO_APP
91+
// CHECK-POWERPC64-LABEL: reg_i64:
92+
// CHECK-POWERPC64: #APP
93+
// CHECK-POWERPC64: mr {{[0-9]+}}, {{[0-9]+}}
94+
// CHECK-POWERPC64: #NO_APP
9595
#[cfg(powerpc64)]
9696
check!(reg_i64, i64, reg, "mr");
9797

@@ -113,10 +113,10 @@ check!(reg_i16_nz, i16, reg_nonzero, "mr");
113113
// CHECK: #NO_APP
114114
check!(reg_i32_nz, i32, reg_nonzero, "mr");
115115

116-
// powerpc64-LABEL: reg_i64_nz:
117-
// powerpc64: #APP
118-
// powerpc64: mr {{[0-9]+}}, {{[0-9]+}}
119-
// powerpc64: #NO_APP
116+
// CHECK-POWERPC64-LABEL: reg_i64_nz:
117+
// CHECK-POWERPC64: #APP
118+
// CHECK-POWERPC64: mr {{[0-9]+}}, {{[0-9]+}}
119+
// CHECK-POWERPC64: #NO_APP
120120
#[cfg(powerpc64)]
121121
check!(reg_i64_nz, i64, reg_nonzero, "mr");
122122

@@ -150,10 +150,10 @@ check_reg!(reg_i16_r0, i16, "0", "0", "mr");
150150
// CHECK: #NO_APP
151151
check_reg!(reg_i32_r0, i32, "0", "0", "mr");
152152

153-
// powerpc64-LABEL: reg_i64_r0:
154-
// powerpc64: #APP
155-
// powerpc64: mr 0, 0
156-
// powerpc64: #NO_APP
153+
// CHECK-POWERPC64-LABEL: reg_i64_r0:
154+
// CHECK-POWERPC64: #APP
155+
// CHECK-POWERPC64: mr 0, 0
156+
// CHECK-POWERPC64: #NO_APP
157157
#[cfg(powerpc64)]
158158
check_reg!(reg_i64_r0, i64, "0", "0", "mr");
159159

@@ -175,10 +175,10 @@ check_reg!(reg_i16_r18, i16, "18", "18", "mr");
175175
// CHECK: #NO_APP
176176
check_reg!(reg_i32_r18, i32, "18", "18", "mr");
177177

178-
// powerpc64-LABEL: reg_i64_r18:
179-
// powerpc64: #APP
180-
// powerpc64: mr 18, 18
181-
// powerpc64: #NO_APP
178+
// CHECK-POWERPC64-LABEL: reg_i64_r18:
179+
// CHECK-POWERPC64: #APP
180+
// CHECK-POWERPC64: mr 18, 18
181+
// CHECK-POWERPC64: #NO_APP
182182
#[cfg(powerpc64)]
183183
check_reg!(reg_i64_r18, i64, "18", "18", "mr");
184184

tests/assembly/asm/riscv-types.rs

+23-23
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//@[riscv64-zfhmin] compile-flags: --target riscv64imac-unknown-none-elf --cfg riscv64
1111
//@[riscv64-zfhmin] needs-llvm-components: riscv
1212
//@[riscv64-zfhmin] compile-flags: -C target-feature=+zfhmin
13-
//@[riscv64-zfhmin] filecheck-flags: --check-prefix riscv64
13+
//@[riscv64-zfhmin] filecheck-flags: --check-prefix CHECK-RISCV64
1414

1515
//@[riscv32-zfhmin] compile-flags: --target riscv32imac-unknown-none-elf
1616
//@[riscv32-zfhmin] needs-llvm-components: riscv
@@ -19,12 +19,12 @@
1919
//@[riscv64-zfh] compile-flags: --target riscv64imac-unknown-none-elf --cfg riscv64
2020
//@[riscv64-zfh] needs-llvm-components: riscv
2121
//@[riscv64-zfh] compile-flags: -C target-feature=+zfh
22-
//@[riscv64-zfh] filecheck-flags: --check-prefix riscv64 --check-prefix zfhmin
22+
//@[riscv64-zfh] filecheck-flags: --check-prefix CHECK-RISCV64 --check-prefix CHECK-ZFHMIN
2323

2424
//@[riscv32-zfh] compile-flags: --target riscv32imac-unknown-none-elf
2525
//@[riscv32-zfh] needs-llvm-components: riscv
2626
//@[riscv32-zfh] compile-flags: -C target-feature=+zfh
27-
//@[riscv32-zfh] filecheck-flags: --check-prefix zfhmin
27+
//@[riscv32-zfh] filecheck-flags: --check-prefix CHECK-ZFHMIN
2828

2929
//@ compile-flags: -C target-feature=+d
3030

@@ -150,17 +150,17 @@ check!(reg_i32 i32 reg "mv");
150150
// CHECK: #NO_APP
151151
check!(reg_f32 f32 reg "mv");
152152

153-
// riscv64-LABEL: reg_i64:
154-
// riscv64: #APP
155-
// riscv64: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
156-
// riscv64: #NO_APP
153+
// CHECK-RISCV64-LABEL: reg_i64:
154+
// CHECK-RISCV64: #APP
155+
// CHECK-RISCV64: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
156+
// CHECK-RISCV64: #NO_APP
157157
#[cfg(riscv64)]
158158
check!(reg_i64 i64 reg "mv");
159159

160-
// riscv64-LABEL: reg_f64:
161-
// riscv64: #APP
162-
// riscv64: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
163-
// riscv64: #NO_APP
160+
// CHECK-RISCV64-LABEL: reg_f64:
161+
// CHECK-RISCV64: #APP
162+
// CHECK-RISCV64: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
163+
// CHECK-RISCV64: #NO_APP
164164
#[cfg(riscv64)]
165165
check!(reg_f64 f64 reg "mv");
166166

@@ -171,11 +171,11 @@ check!(reg_f64 f64 reg "mv");
171171
check!(reg_ptr ptr reg "mv");
172172

173173
// CHECK-LABEL: freg_f16:
174-
// zfhmin-NOT: or
174+
// CHECK-ZFHMIN-NOT: or
175175
// CHECK: #APP
176176
// CHECK: fmv.s f{{[a-z0-9]+}}, f{{[a-z0-9]+}}
177177
// CHECK: #NO_APP
178-
// zfhmin-NOT: or
178+
// CHECK-ZFHMIN-NOT: or
179179
check!(freg_f16 f16 freg "fmv.s");
180180

181181
// CHECK-LABEL: freg_f32:
@@ -220,17 +220,17 @@ check_reg!(a0_i32 i32 "a0" "mv");
220220
// CHECK: #NO_APP
221221
check_reg!(a0_f32 f32 "a0" "mv");
222222

223-
// riscv64-LABEL: a0_i64:
224-
// riscv64: #APP
225-
// riscv64: mv a0, a0
226-
// riscv64: #NO_APP
223+
// CHECK-RISCV64-LABEL: a0_i64:
224+
// CHECK-RISCV64: #APP
225+
// CHECK-RISCV64: mv a0, a0
226+
// CHECK-RISCV64: #NO_APP
227227
#[cfg(riscv64)]
228228
check_reg!(a0_i64 i64 "a0" "mv");
229229

230-
// riscv64-LABEL: a0_f64:
231-
// riscv64: #APP
232-
// riscv64: mv a0, a0
233-
// riscv64: #NO_APP
230+
// CHECK-RISCV64-LABEL: a0_f64:
231+
// CHECK-RISCV64: #APP
232+
// CHECK-RISCV64: mv a0, a0
233+
// CHECK-RISCV64: #NO_APP
234234
#[cfg(riscv64)]
235235
check_reg!(a0_f64 f64 "a0" "mv");
236236

@@ -241,11 +241,11 @@ check_reg!(a0_f64 f64 "a0" "mv");
241241
check_reg!(a0_ptr ptr "a0" "mv");
242242

243243
// CHECK-LABEL: fa0_f16:
244-
// zfhmin-NOT: or
244+
// CHECK-ZFHMIN-NOT: or
245245
// CHECK: #APP
246246
// CHECK: fmv.s fa0, fa0
247247
// CHECK: #NO_APP
248-
// zfhmin-NOT: or
248+
// CHECK-ZFHMIN-NOT: or
249249
check_reg!(fa0_f16 f16 "fa0" "fmv.s");
250250

251251
// CHECK-LABEL: fa0_f32:

tests/assembly/asm/x86-modifiers.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ macro_rules! check {
5353

5454
// CHECK-LABEL: reg:
5555
// CHECK: #APP
56-
// x86_64: mov rax, rax
57-
// i686: mov eax, eax
56+
// CHECK-X86_64: mov rax, rax
57+
// CHECK-I686: mov eax, eax
5858
// CHECK: #NO_APP
5959
check!(reg "" reg "mov");
6060

61-
// x86_64-LABEL: reg_l:
62-
// x86_64: #APP
63-
// x86_64: mov al, al
64-
// x86_64: #NO_APP
61+
// CHECK-X86_64-LABEL: reg_l:
62+
// CHECK-X86_64: #APP
63+
// CHECK-X86_64: mov al, al
64+
// CHECK-X86_64: #NO_APP
6565
#[cfg(x86_64)]
6666
check!(reg_l "l" reg "mov");
6767

@@ -77,17 +77,17 @@ check!(reg_x "x" reg "mov");
7777
// CHECK: #NO_APP
7878
check!(reg_e "e" reg "mov");
7979

80-
// x86_64-LABEL: reg_r:
81-
// x86_64: #APP
82-
// x86_64: mov rax, rax
83-
// x86_64: #NO_APP
80+
// CHECK-X86_64-LABEL: reg_r:
81+
// CHECK-X86_64: #APP
82+
// CHECK-X86_64: mov rax, rax
83+
// CHECK-X86_64: #NO_APP
8484
#[cfg(x86_64)]
8585
check!(reg_r "r" reg "mov");
8686

8787
// CHECK-LABEL: reg_abcd:
8888
// CHECK: #APP
89-
// x86_64: mov rax, rax
90-
// i686: mov eax, eax
89+
// CHECK-X86_64: mov rax, rax
90+
// CHECK-I686: mov eax, eax
9191
// CHECK: #NO_APP
9292
check!(reg_abcd "" reg_abcd "mov");
9393

@@ -115,10 +115,10 @@ check!(reg_abcd_x "x" reg_abcd "mov");
115115
// CHECK: #NO_APP
116116
check!(reg_abcd_e "e" reg_abcd "mov");
117117

118-
// x86_64-LABEL: reg_abcd_r:
119-
// x86_64: #APP
120-
// x86_64: mov rax, rax
121-
// x86_64: #NO_APP
118+
// CHECK-X86_64-LABEL: reg_abcd_r:
119+
// CHECK-X86_64: #APP
120+
// CHECK-X86_64: mov rax, rax
121+
// CHECK-X86_64: #NO_APP
122122
#[cfg(x86_64)]
123123
check!(reg_abcd_r "r" reg_abcd "mov");
124124

0 commit comments

Comments
 (0)