fix wasm test

This commit is contained in:
Ralf Jung 2024-08-29 07:50:18 +02:00
parent a10633afe6
commit b5be3ab38b
15 changed files with 28 additions and 15 deletions

View File

@ -1,4 +1,4 @@
//@only-target-wasm32: tests WASM-specific behavior //@only-target-wasm: tests WASM-specific behavior
//@compile-flags: -C target-feature=-simd128 //@compile-flags: -C target-feature=-simd128
fn main() { fn main() {
@ -6,7 +6,7 @@ fn main() {
// But if the compiler actually uses the target feature, it will lead to an error when the module is loaded. // But if the compiler actually uses the target feature, it will lead to an error when the module is loaded.
// We emulate this with an "unsupported" error. // We emulate this with an "unsupported" error.
assert!(!cfg!(target_feature = "simd128")); assert!(!cfg!(target_feature = "simd128"));
simd128_fn(); simd128_fn(); //~ERROR: unavailable target features
} }
#[target_feature(enable = "simd128")] #[target_feature(enable = "simd128")]

View File

@ -0,0 +1,13 @@
error: abnormal termination: calling a function that requires unavailable target features: simd128
--> $DIR/target_feature_wasm.rs:LL:CC
|
LL | simd128_fn();
| ^^^^^^^^^^^^ calling a function that requires unavailable target features: simd128
|
= note: BACKTRACE:
= note: inside `main` at $DIR/target_feature_wasm.rs:LL:CC
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
error: aborting due to 1 previous error

View File

@ -7,7 +7,7 @@
//@ignore-target-avr //@ignore-target-avr
//@ignore-target-s390x //@ignore-target-s390x
//@ignore-target-thumbv7em //@ignore-target-thumbv7em
//@ignore-target-wasm32 //@ignore-target-wasm
// Explicitly disable SSE4.1 because it is enabled by default on macOS // Explicitly disable SSE4.1 because it is enabled by default on macOS
//@compile-flags: -C target-feature=-sse4.1 //@compile-flags: -C target-feature=-sse4.1

View File

@ -6,7 +6,7 @@
//@ignore-target-avr //@ignore-target-avr
//@ignore-target-s390x //@ignore-target-s390x
//@ignore-target-thumbv7em //@ignore-target-thumbv7em
//@ignore-target-wasm32 //@ignore-target-wasm
//@compile-flags: -C target-feature=+sha,+sse2,+ssse3,+sse4.1 //@compile-flags: -C target-feature=+sha,+sse2,+ssse3,+sse4.1
#[cfg(target_arch = "x86")] #[cfg(target_arch = "x86")]

View File

@ -6,7 +6,7 @@
//@ignore-target-avr //@ignore-target-avr
//@ignore-target-s390x //@ignore-target-s390x
//@ignore-target-thumbv7em //@ignore-target-thumbv7em
//@ignore-target-wasm32 //@ignore-target-wasm
//@compile-flags: -C target-feature=+adx //@compile-flags: -C target-feature=+adx
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]

View File

@ -6,7 +6,7 @@
//@ignore-target-avr //@ignore-target-avr
//@ignore-target-s390x //@ignore-target-s390x
//@ignore-target-thumbv7em //@ignore-target-thumbv7em
//@ignore-target-wasm32 //@ignore-target-wasm
//@compile-flags: -C target-feature=+aes,+vaes,+avx512f //@compile-flags: -C target-feature=+aes,+vaes,+avx512f
#![feature(avx512_target_feature, stdarch_x86_avx512)] #![feature(avx512_target_feature, stdarch_x86_avx512)]

View File

@ -6,7 +6,7 @@
//@ignore-target-avr //@ignore-target-avr
//@ignore-target-s390x //@ignore-target-s390x
//@ignore-target-thumbv7em //@ignore-target-thumbv7em
//@ignore-target-wasm32 //@ignore-target-wasm
//@compile-flags: -C target-feature=+avx //@compile-flags: -C target-feature=+avx
#[cfg(target_arch = "x86")] #[cfg(target_arch = "x86")]

View File

@ -6,7 +6,7 @@
//@ignore-target-avr //@ignore-target-avr
//@ignore-target-s390x //@ignore-target-s390x
//@ignore-target-thumbv7em //@ignore-target-thumbv7em
//@ignore-target-wasm32 //@ignore-target-wasm
//@compile-flags: -C target-feature=+avx2 //@compile-flags: -C target-feature=+avx2
#[cfg(target_arch = "x86")] #[cfg(target_arch = "x86")]

View File

@ -6,7 +6,7 @@
//@ignore-target-avr //@ignore-target-avr
//@ignore-target-s390x //@ignore-target-s390x
//@ignore-target-thumbv7em //@ignore-target-thumbv7em
//@ignore-target-wasm32 //@ignore-target-wasm
//@compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bitalg,+avx512vpopcntdq //@compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bitalg,+avx512vpopcntdq
#![feature(avx512_target_feature)] #![feature(avx512_target_feature)]

View File

@ -6,7 +6,7 @@
//@ignore-target-avr //@ignore-target-avr
//@ignore-target-s390x //@ignore-target-s390x
//@ignore-target-thumbv7em //@ignore-target-thumbv7em
//@ignore-target-wasm32 //@ignore-target-wasm
//@compile-flags: -C target-feature=+bmi1,+bmi2 //@compile-flags: -C target-feature=+bmi1,+bmi2
#[cfg(target_arch = "x86")] #[cfg(target_arch = "x86")]

View File

@ -6,7 +6,7 @@
//@ignore-target-avr //@ignore-target-avr
//@ignore-target-s390x //@ignore-target-s390x
//@ignore-target-thumbv7em //@ignore-target-thumbv7em
//@ignore-target-wasm32 //@ignore-target-wasm
//@compile-flags: -C target-feature=-sse2 //@compile-flags: -C target-feature=-sse2
#[cfg(target_arch = "x86")] #[cfg(target_arch = "x86")]

View File

@ -6,7 +6,7 @@
//@ignore-target-avr //@ignore-target-avr
//@ignore-target-s390x //@ignore-target-s390x
//@ignore-target-thumbv7em //@ignore-target-thumbv7em
//@ignore-target-wasm32 //@ignore-target-wasm
//@compile-flags: -C target-feature=+pclmulqdq //@compile-flags: -C target-feature=+pclmulqdq
#[cfg(target_arch = "x86")] #[cfg(target_arch = "x86")]

View File

@ -6,7 +6,7 @@
//@ignore-target-avr //@ignore-target-avr
//@ignore-target-s390x //@ignore-target-s390x
//@ignore-target-thumbv7em //@ignore-target-thumbv7em
//@ignore-target-wasm32 //@ignore-target-wasm
// SSSE3 implicitly enables SSE3 // SSSE3 implicitly enables SSE3
//@compile-flags: -C target-feature=+ssse3 //@compile-flags: -C target-feature=+ssse3

View File

@ -6,7 +6,7 @@
//@ignore-target-avr //@ignore-target-avr
//@ignore-target-s390x //@ignore-target-s390x
//@ignore-target-thumbv7em //@ignore-target-thumbv7em
//@ignore-target-wasm32 //@ignore-target-wasm
//@compile-flags: -C target-feature=+sse4.1 //@compile-flags: -C target-feature=+sse4.1
#[cfg(target_arch = "x86")] #[cfg(target_arch = "x86")]

View File

@ -6,7 +6,7 @@
//@ignore-target-avr //@ignore-target-avr
//@ignore-target-s390x //@ignore-target-s390x
//@ignore-target-thumbv7em //@ignore-target-thumbv7em
//@ignore-target-wasm32 //@ignore-target-wasm
//@compile-flags: -C target-feature=+sse4.2 //@compile-flags: -C target-feature=+sse4.2
#[cfg(target_arch = "x86")] #[cfg(target_arch = "x86")]