Skip to content

Commit

Permalink
Make use of normalized filecheck directives
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
tgross35 committed Jul 20, 2024
1 parent 73ec736 commit 6b8b6b7
Show file tree
Hide file tree
Showing 98 changed files with 2,108 additions and 2,062 deletions.
418 changes: 209 additions & 209 deletions tests/assembly/asm/arm-types.rs

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions tests/assembly/asm/mips-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,44 +70,44 @@ macro_rules! check_reg { ($func:ident, $ty:ty, $reg:tt, $mov:literal) => {
}
};}

// mips32-LABEL: sym_static_32:
// mips32: #APP
// mips32: lw $3, %got(extern_static)($gp)
// mips32: #NO_APP
// CHECK-MIPS32-LABEL: sym_static_32:
// CHECK-MIPS32: #APP
// CHECK-MIPS32: lw $3, %got(extern_static)($gp)
// CHECK-MIPS32: #NO_APP
#[cfg(mips32)]
#[no_mangle]
pub unsafe fn sym_static_32() {
asm!("lw $v1, {}", sym extern_static);
}

// mips32-LABEL: sym_fn_32:
// mips32: #APP
// mips32: lw $3, %got(extern_func)($gp)
// mips32: #NO_APP
// CHECK-MIPS32-LABEL: sym_fn_32:
// CHECK-MIPS32: #APP
// CHECK-MIPS32: lw $3, %got(extern_func)($gp)
// CHECK-MIPS32: #NO_APP
#[cfg(mips32)]
#[no_mangle]
pub unsafe fn sym_fn_32() {
asm!("lw $v1, {}", sym extern_func);
}

// mips64-LABEL: sym_static_64:
// mips64: #APP
// mips64: lui $3, %got_hi(extern_static)
// mips64: daddu $3, $3, $gp
// mips64: ld $3, %got_lo(extern_static)($3)
// mips64: #NO_APP
// CHECK-MIPS64-LABEL: sym_static_64:
// CHECK-MIPS64: #APP
// CHECK-MIPS64: lui $3, %got_hi(extern_static)
// CHECK-MIPS64: daddu $3, $3, $gp
// CHECK-MIPS64: ld $3, %got_lo(extern_static)($3)
// CHECK-MIPS64: #NO_APP
#[cfg(mips64)]
#[no_mangle]
pub unsafe fn sym_static_64() {
asm!("ld $v1, {}", sym extern_static);
}

// mips64-LABEL: sym_fn_64:
// mips64: #APP
// mips64: lui $3, %got_hi(extern_func)
// mips64: daddu $3, $3, $gp
// mips64: ld $3, %got_lo(extern_func)($3)
// mips64: #NO_APP
// CHECK-MIPS64-LABEL: sym_fn_64:
// CHECK-MIPS64: #APP
// CHECK-MIPS64: lui $3, %got_hi(extern_func)
// CHECK-MIPS64: daddu $3, $3, $gp
// CHECK-MIPS64: ld $3, %got_lo(extern_func)($3)
// CHECK-MIPS64: #NO_APP
#[cfg(mips64)]
#[no_mangle]
pub unsafe fn sym_fn_64() {
Expand Down Expand Up @@ -172,10 +172,10 @@ check!(reg_i32, i32, reg, "move");
// CHECK: #NO_APP
check!(reg_f32_soft, f32, reg, "move");

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

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

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

Expand Down
32 changes: 16 additions & 16 deletions tests/assembly/asm/powerpc-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ check!(reg_i16, i16, reg, "mr");
// CHECK: #NO_APP
check!(reg_i32, i32, reg, "mr");

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

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

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

Expand Down Expand Up @@ -150,10 +150,10 @@ check_reg!(reg_i16_r0, i16, "0", "0", "mr");
// CHECK: #NO_APP
check_reg!(reg_i32_r0, i32, "0", "0", "mr");

// powerpc64-LABEL: reg_i64_r0:
// powerpc64: #APP
// powerpc64: mr 0, 0
// powerpc64: #NO_APP
// CHECK-POWERPC64-LABEL: reg_i64_r0:
// CHECK-POWERPC64: #APP
// CHECK-POWERPC64: mr 0, 0
// CHECK-POWERPC64: #NO_APP
#[cfg(powerpc64)]
check_reg!(reg_i64_r0, i64, "0", "0", "mr");

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

// powerpc64-LABEL: reg_i64_r18:
// powerpc64: #APP
// powerpc64: mr 18, 18
// powerpc64: #NO_APP
// CHECK-POWERPC64-LABEL: reg_i64_r18:
// CHECK-POWERPC64: #APP
// CHECK-POWERPC64: mr 18, 18
// CHECK-POWERPC64: #NO_APP
#[cfg(powerpc64)]
check_reg!(reg_i64_r18, i64, "18", "18", "mr");

Expand Down
46 changes: 23 additions & 23 deletions tests/assembly/asm/riscv-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//@[riscv64-zfhmin] compile-flags: --target riscv64imac-unknown-none-elf --cfg riscv64
//@[riscv64-zfhmin] needs-llvm-components: riscv
//@[riscv64-zfhmin] compile-flags: -C target-feature=+zfhmin
//@[riscv64-zfhmin] filecheck-flags: --check-prefix riscv64
//@[riscv64-zfhmin] filecheck-flags: --check-prefix CHECK-RISCV64

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

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

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

Expand Down Expand Up @@ -150,17 +150,17 @@ check!(reg_i32 i32 reg "mv");
// CHECK: #NO_APP
check!(reg_f32 f32 reg "mv");

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

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

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

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

// CHECK-LABEL: freg_f32:
Expand Down Expand Up @@ -220,17 +220,17 @@ check_reg!(a0_i32 i32 "a0" "mv");
// CHECK: #NO_APP
check_reg!(a0_f32 f32 "a0" "mv");

// riscv64-LABEL: a0_i64:
// riscv64: #APP
// riscv64: mv a0, a0
// riscv64: #NO_APP
// CHECK-RISCV64-LABEL: a0_i64:
// CHECK-RISCV64: #APP
// CHECK-RISCV64: mv a0, a0
// CHECK-RISCV64: #NO_APP
#[cfg(riscv64)]
check_reg!(a0_i64 i64 "a0" "mv");

// riscv64-LABEL: a0_f64:
// riscv64: #APP
// riscv64: mv a0, a0
// riscv64: #NO_APP
// CHECK-RISCV64-LABEL: a0_f64:
// CHECK-RISCV64: #APP
// CHECK-RISCV64: mv a0, a0
// CHECK-RISCV64: #NO_APP
#[cfg(riscv64)]
check_reg!(a0_f64 f64 "a0" "mv");

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

// CHECK-LABEL: fa0_f16:
// zfhmin-NOT: or
// CHECK-ZFHMIN-NOT: or
// CHECK: #APP
// CHECK: fmv.s fa0, fa0
// CHECK: #NO_APP
// zfhmin-NOT: or
// CHECK-ZFHMIN-NOT: or
check_reg!(fa0_f16 f16 "fa0" "fmv.s");

// CHECK-LABEL: fa0_f32:
Expand Down
32 changes: 16 additions & 16 deletions tests/assembly/asm/x86-modifiers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ macro_rules! check {

// CHECK-LABEL: reg:
// CHECK: #APP
// x86_64: mov rax, rax
// i686: mov eax, eax
// CHECK-X86_64: mov rax, rax
// CHECK-I686: mov eax, eax
// CHECK: #NO_APP
check!(reg "" reg "mov");

// x86_64-LABEL: reg_l:
// x86_64: #APP
// x86_64: mov al, al
// x86_64: #NO_APP
// CHECK-X86_64-LABEL: reg_l:
// CHECK-X86_64: #APP
// CHECK-X86_64: mov al, al
// CHECK-X86_64: #NO_APP
#[cfg(x86_64)]
check!(reg_l "l" reg "mov");

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

// x86_64-LABEL: reg_r:
// x86_64: #APP
// x86_64: mov rax, rax
// x86_64: #NO_APP
// CHECK-X86_64-LABEL: reg_r:
// CHECK-X86_64: #APP
// CHECK-X86_64: mov rax, rax
// CHECK-X86_64: #NO_APP
#[cfg(x86_64)]
check!(reg_r "r" reg "mov");

// CHECK-LABEL: reg_abcd:
// CHECK: #APP
// x86_64: mov rax, rax
// i686: mov eax, eax
// CHECK-X86_64: mov rax, rax
// CHECK-I686: mov eax, eax
// CHECK: #NO_APP
check!(reg_abcd "" reg_abcd "mov");

Expand Down Expand Up @@ -115,10 +115,10 @@ check!(reg_abcd_x "x" reg_abcd "mov");
// CHECK: #NO_APP
check!(reg_abcd_e "e" reg_abcd "mov");

// x86_64-LABEL: reg_abcd_r:
// x86_64: #APP
// x86_64: mov rax, rax
// x86_64: #NO_APP
// CHECK-X86_64-LABEL: reg_abcd_r:
// CHECK-X86_64: #APP
// CHECK-X86_64: mov rax, rax
// CHECK-X86_64: #NO_APP
#[cfg(x86_64)]
check!(reg_abcd_r "r" reg_abcd "mov");

Expand Down
Loading

0 comments on commit 6b8b6b7

Please sign in to comment.