Skip to content

Commit

Permalink
Update test directives for wasm32-wasip1
Browse files Browse the repository at this point in the history
* The WASI targets deal with the `main` symbol a bit differently than
  native so some `codegen` and `assembly` tests have been ignored.
* All `ignore-emscripten` directives have been updated to
  `ignore-wasm32` to be more clear that all wasm targets are ignored and
  it's not just Emscripten.
* Most `ignore-wasm32-bare` directives are now gone.
* Some ignore directives for wasm were switched to `needs-unwind`
  instead.
* Many `ignore-wasm32*` directives are removed as the tests work with
  WASI as opposed to `wasm32-unknown-unknown`.
  • Loading branch information
alexcrichton committed Mar 6, 2024
1 parent e9397e4 commit 284297b
Show file tree
Hide file tree
Showing 196 changed files with 211 additions and 335 deletions.
2 changes: 1 addition & 1 deletion tests/assembly/wasm_exceptions.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ only-wasm32-bare
//@ only-wasm32
//@ assembly-output: emit-asm
//@ compile-flags: -C target-feature=+exception-handling
//@ compile-flags: -C panic=unwind
Expand Down
1 change: 1 addition & 0 deletions tests/codegen/abi-main-signature-32bit-c-int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// This test is for targets with 32bit c_int only.
//@ ignore-msp430
//@ ignore-avr
//@ ignore-wasi wasi codegens the main symbol differently

fn main() {
}
Expand Down
1 change: 0 additions & 1 deletion tests/codegen/drop.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//@ ignore-wasm32-bare compiled with panic=abort by default
//@ needs-unwind - this test verifies the amount of drop calls when unwinding is used
//@ compile-flags: -C no-prepopulate-passes

Expand Down
1 change: 1 addition & 0 deletions tests/codegen/enum/enum-debug-clike.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

//
//@ ignore-msvc
//@ ignore-wasi wasi codegens the main symbol differently

//@ compile-flags: -g -C no-prepopulate-passes

Expand Down
1 change: 1 addition & 0 deletions tests/codegen/enum/enum-debug-niche.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// This is ignored for the fallback mode on MSVC due to problems with PDB.

//@ ignore-msvc
//@ ignore-wasi wasi codegens the main symbol differently

//@ compile-flags: -g -C no-prepopulate-passes

Expand Down
1 change: 1 addition & 0 deletions tests/codegen/enum/enum-debug-tagged.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// This is ignored for the fallback mode on MSVC due to problems with PDB.

//@ ignore-msvc
//@ ignore-wasi wasi codegens the main symbol differently

//@ compile-flags: -g -C no-prepopulate-passes

Expand Down
1 change: 1 addition & 0 deletions tests/codegen/enum/enum-u128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

//
//@ ignore-msvc
//@ ignore-wasi wasi codegens the main symbol differently

//@ compile-flags: -g -C no-prepopulate-passes

Expand Down
1 change: 1 addition & 0 deletions tests/codegen/fn-impl-trait-self.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@ compile-flags: -g
//@ ignore-wasi wasi codegens the main symbol differently
//
// CHECK-LABEL: @main
// MSVC: {{.*}}DIDerivedType(tag: DW_TAG_pointer_type, name: "recursive_type$ (*)()",{{.*}}
Expand Down
1 change: 1 addition & 0 deletions tests/codegen/generic-debug.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//@ ignore-windows
//@ ignore-wasi wasi codegens the main symbol differently

//@ compile-flags: -g -C no-prepopulate-passes

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/link_section.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-emscripten default visibility is hidden
//@ ignore-wasm32 custom sections work differently on wasm
//@ compile-flags: -C no-prepopulate-passes

#![crate_type = "lib"]
Expand Down
1 change: 1 addition & 0 deletions tests/codegen/mainsubprogram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

//@ ignore-windows
//@ ignore-macos
//@ ignore-wasi

//@ compile-flags: -g -C no-prepopulate-passes

Expand Down
1 change: 1 addition & 0 deletions tests/codegen/mainsubprogramstart.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ ignore-windows
//@ ignore-macos
//@ ignore-wasi wasi codegens the main symbol differently

//@ compile-flags: -g -C no-prepopulate-passes

Expand Down
1 change: 0 additions & 1 deletion tests/codegen/personality_lifetimes.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ ignore-msvc
//@ ignore-wasm32-bare compiled with panic=abort by default
//@ needs-unwind

//@ compile-flags: -O -C no-prepopulate-passes
Expand Down
4 changes: 1 addition & 3 deletions tests/codegen/repr/transparent-imm-array.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
//@ revisions: arm mips thumb wasm32
//@ revisions: arm mips thumb
//@ compile-flags: -C no-prepopulate-passes
//
//@[arm] only-arm
//@[mips] only-mips
//@[thumb] only-thumb
//@[wasm32] only-wasm32
//@ ignore-emscripten
// See ./transparent.rs
// Some platforms pass large aggregates using immediate arrays in LLVMIR
// Other platforms pass large aggregates using struct pointer in LLVMIR
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ compile-flags: -C opt-level=0 -Cpanic=abort
//@ ignore-wasm32-bare compiled with panic=abort by default

#![crate_type = "lib"]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ compile-flags: -C opt-level=0
//@ ignore-wasm32-bare compiled with panic=abort by default
//@ needs-unwind

#![crate_type = "lib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/unwind-abis/nounwind.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ compile-flags: -C opt-level=0 -Cpanic=abort
//@ ignore-wasm32-bare compiled with panic=abort by default
//@ needs-unwind

#![crate_type = "lib"]
#![feature(c_unwind)]
Expand Down
1 change: 0 additions & 1 deletion tests/codegen/unwind-extern-exports.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ compile-flags: -C opt-level=0
//@ ignore-wasm32-bare compiled with panic=abort by default
//@ needs-unwind

#![crate_type = "lib"]
Expand Down
1 change: 0 additions & 1 deletion tests/codegen/unwind-extern-imports.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ compile-flags: -C no-prepopulate-passes
//@ ignore-wasm32-bare compiled with panic=abort by default
//@ needs-unwind

#![crate_type = "lib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/wasm_exceptions.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ only-wasm32-bare
//@ only-wasm32
//@ compile-flags: -C panic=unwind

#![crate_type = "lib"]
Expand Down
1 change: 0 additions & 1 deletion tests/incremental/change_crate_dep_kind.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Test that we detect changes to the `dep_kind` query. If the change is not
// detected then -Zincremental-verify-ich will trigger an assertion.

//@ ignore-wasm32-bare compiled with panic=abort by default
//@ needs-unwind
//@ revisions:cfail1 cfail2
//@ compile-flags: -Z query-dep-graph -Cpanic=unwind
Expand Down
1 change: 0 additions & 1 deletion tests/incremental/issue-54059.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ aux-build:issue-54059.rs
//@ ignore-wasm32-bare no libc for ffi testing
//@ ignore-windows - dealing with weird symbols issues on dylibs isn't worth it
//@ revisions: rpass1

Expand Down
2 changes: 1 addition & 1 deletion tests/run-pass-valgrind/exit-flushes.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ ignore-emscripten
//@ ignore-wasm32 no subprocess support
//@ ignore-sgx no processes
//@ ignore-macos this needs valgrind 3.11 or higher; see
// https://github.com/rust-lang/rust/pull/30365#issuecomment-165763679
Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/anon-extern-mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ run-pass
//@ pretty-expanded FIXME #23616
//@ ignore-wasm32-bare no libc to test ffi with

#![feature(rustc_private)]

Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/c-stack-as-value.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ run-pass
//@ pretty-expanded FIXME #23616
//@ ignore-wasm32-bare no libc to test ffi with

#![feature(rustc_private)]

Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/c-stack-returning-int64.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ run-pass
//@ ignore-wasm32-bare no libc to test with
//@ ignore-sgx no libc

#![feature(rustc_private)]
Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/cabi-int-widening.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ run-pass
//@ ignore-wasm32-bare no libc to test ffi with

#[link(name = "rust_test_helpers", kind = "static")]
extern "C" {
Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/cross-crate/anon-extern-mod-cross-crate-2.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ run-pass
//@ aux-build:anon-extern-mod-cross-crate-1.rs
//@ pretty-expanded FIXME #23616
//@ ignore-wasm32-bare no libc to test ffi with

extern crate anonexternmod;

Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/cross-crate/duplicated-external-mods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//@ aux-build:anon-extern-mod-cross-crate-1.rs
//@ aux-build:anon-extern-mod-cross-crate-1.rs
//@ pretty-expanded FIXME #23616
//@ ignore-wasm32-bare no libc to test ffi with

extern crate anonexternmod;

Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/extern/extern-call-deep.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ run-pass
//@ ignore-wasm32-bare no libc to test ffi with
//@ ignore-emscripten blows the JS stack

#![feature(rustc_private)]
Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/extern/extern-call-indirect.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ run-pass
//@ ignore-wasm32-bare no libc to test ffi with

#![feature(rustc_private)]

Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/extern/extern-crosscrate.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ run-pass
//@ aux-build:extern-crosscrate-source.rs
//@ ignore-wasm32-bare no libc to test ffi with

#![feature(rustc_private)]

Expand Down
2 changes: 0 additions & 2 deletions tests/ui/abi/extern/extern-pass-TwoU16s.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@ run-pass
#![allow(improper_ctypes)]

//@ ignore-wasm32-bare no libc for ffi testing

// Test a foreign function that accepts and returns a struct
// by value.

Expand Down
2 changes: 0 additions & 2 deletions tests/ui/abi/extern/extern-pass-TwoU32s.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@ run-pass
#![allow(improper_ctypes)]

//@ ignore-wasm32-bare no libc for ffi testing

// Test a foreign function that accepts and returns a struct
// by value.

Expand Down
2 changes: 0 additions & 2 deletions tests/ui/abi/extern/extern-pass-TwoU64s.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@ run-pass
#![allow(improper_ctypes)]

//@ ignore-wasm32-bare no libc for ffi testing

// Test a foreign function that accepts and returns a struct
// by value.

Expand Down
2 changes: 0 additions & 2 deletions tests/ui/abi/extern/extern-pass-TwoU8s.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@ run-pass
#![allow(improper_ctypes)]

//@ ignore-wasm32-bare no libc for ffi testing

// Test a foreign function that accepts and returns a struct
// by value.

Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/extern/extern-pass-char.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ run-pass
//@ ignore-wasm32-bare no libc for ffi testing

// Test a function that takes/returns a u8.

Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/extern/extern-pass-double.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ run-pass
//@ ignore-wasm32-bare no libc for ffi testing

#[link(name = "rust_test_helpers", kind = "static")]
extern "C" {
Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/extern/extern-pass-u32.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ run-pass
//@ ignore-wasm32-bare no libc for ffi testing

// Test a function that takes/returns a u32.

Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/extern/extern-pass-u64.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ run-pass
//@ ignore-wasm32-bare no libc for ffi testing

// Test a call to a function that takes/returns a u64.

Expand Down
2 changes: 0 additions & 2 deletions tests/ui/abi/extern/extern-return-TwoU16s.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@ run-pass
#![allow(improper_ctypes)]

//@ ignore-wasm32-bare no libc to test ffi with

pub struct TwoU16s {
one: u16,
two: u16,
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/abi/extern/extern-return-TwoU32s.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@ run-pass
#![allow(improper_ctypes)]

//@ ignore-wasm32-bare no libc to test ffi with

pub struct TwoU32s {
one: u32,
two: u32,
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/abi/extern/extern-return-TwoU64s.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@ run-pass
#![allow(improper_ctypes)]

//@ ignore-wasm32-bare no libc to test ffi with

pub struct TwoU64s {
one: u64,
two: u64,
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/abi/extern/extern-return-TwoU8s.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@ run-pass
#![allow(improper_ctypes)]

//@ ignore-wasm32-bare no libc to test ffi with

pub struct TwoU8s {
one: u8,
two: u8,
Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/foreign/foreign-dupe.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ run-pass
//@ aux-build:foreign_lib.rs
//@ ignore-wasm32-bare no libc to test ffi with

// Check that we can still call duplicated extern (imported) functions
// which were declared in another crate. See issues #32740 and #32783.
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/abi/foreign/foreign-fn-with-byval.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@ run-pass
#![allow(improper_ctypes, improper_ctypes_definitions)]

//@ ignore-wasm32-bare no libc to test ffi with

#[derive(Copy, Clone)]
pub struct S {
x: u64,
Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/foreign/foreign-no-abi.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//@ run-pass
// ABI is cdecl by default

//@ ignore-wasm32-bare no libc to test ffi with
//@ pretty-expanded FIXME #23616

#![feature(rustc_private)]
Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/foreign/invoke-external-foreign.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ run-pass
//@ aux-build:foreign_lib.rs
//@ ignore-wasm32-bare no libc to test ffi with

// The purpose of this test is to check that we can
// successfully (and safely) invoke external, cdecl
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/abi/homogenous-floats-target-feature-mixup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// without #[repr(simd)]

//@ run-pass
//@ ignore-emscripten
//@ ignore-wasm32 no processes
//@ ignore-sgx no processes

#![feature(avx512_target_feature)]
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/abi/issue-28676.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#![allow(dead_code)]
#![allow(improper_ctypes)]

//@ ignore-wasm32-bare no libc to test ffi with

#[derive(Copy, Clone)]
pub struct Quad {
a: u64,
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/abi/issues/issue-62350-sysv-neg-reg-counts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
#![allow(dead_code)]
#![allow(improper_ctypes)]

//@ ignore-wasm32-bare no libc to test ffi with

#[derive(Copy, Clone)]
pub struct QuadFloats {
a: f32,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ run-pass
//@ ignore-wasm
#![allow(dead_code)]
#![allow(improper_ctypes)]

Expand Down
2 changes: 0 additions & 2 deletions tests/ui/abi/lib-defaults.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//@ run-pass
//@ dont-check-compiler-stderr (rust-lang/rust#54222)

//@ ignore-wasm32-bare no libc to test ffi with

//@ compile-flags: -lrust_test_helpers

#[link(name = "rust_test_helpers", kind = "static")]
Expand Down
1 change: 0 additions & 1 deletion tests/ui/abi/mir/mir_codegen_calls_variadic.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ run-pass
//@ ignore-wasm32-bare no libc to test ffi with

#[link(name = "rust_test_helpers", kind = "static")]
extern "C" {
Expand Down
Loading

0 comments on commit 284297b

Please sign in to comment.