Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use explicit cpu in some asm and codegen tests. #138721

Merged
merged 1 commit into from
Mar 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/assembly/powerpc64-struct-abi.rs
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
//@[elfv1-be] needs-llvm-components: powerpc
//@[elfv2-be] compile-flags: --target powerpc64-unknown-linux-musl
//@[elfv2-be] needs-llvm-components: powerpc
//@[elfv2-le] compile-flags: --target powerpc64le-unknown-linux-gnu
//@[elfv2-le] compile-flags: --target powerpc64le-unknown-linux-gnu -C target-cpu=pwr8
//@[elfv2-le] needs-llvm-components: powerpc
//@[aix] compile-flags: --target powerpc64-ibm-aix
//@[aix] needs-llvm-components: powerpc
4 changes: 2 additions & 2 deletions tests/assembly/s390x-vector-abi.rs
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@
// ignore-tidy-linelength
//@ assembly-output: emit-asm
//@ compile-flags: -Copt-level=3 -Z merge-functions=disabled
//@[z10] compile-flags: --target s390x-unknown-linux-gnu --cfg no_vector
//@[z10] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z10 --cfg no_vector
//@[z10] needs-llvm-components: systemz
//@[z10_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-feature=+vector
//@[z10_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z10 -C target-feature=+vector
//@[z10_vector] needs-llvm-components: systemz
//@[z13] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13
//@[z13] needs-llvm-components: systemz
2 changes: 1 addition & 1 deletion tests/codegen/asm/s390x-clobbers.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ add-core-stubs
//@ revisions: s390x
//@[s390x] compile-flags: --target s390x-unknown-linux-gnu
//@[s390x] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z10
//@[s390x] needs-llvm-components: systemz

#![crate_type = "rlib"]
2 changes: 1 addition & 1 deletion tests/codegen/slice-is-ascii.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ only-x86_64
//@ compile-flags: -C opt-level=3
//@ compile-flags: -C opt-level=3 -C target-cpu=x86-64
#![crate_type = "lib"]

/// Check that the fast-path of `is_ascii` uses a `pmovmskb` instruction.
1 change: 1 addition & 0 deletions tests/ui/abi/simd-abi-checks-avx.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//@ only-x86_64
//@ build-pass
//@ ignore-pass (test emits codegen-time warnings)
//@ compile-flags: -C target-feature=-avx

#![feature(avx512_target_feature)]
#![feature(portable_simd)]
44 changes: 22 additions & 22 deletions tests/ui/abi/simd-abi-checks-avx.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:64:11
--> $DIR/simd-abi-checks-avx.rs:65:11
|
LL | f(g());
| ^^^ function called here
@@ -10,7 +10,7 @@ LL | f(g());
= note: `#[warn(abi_unsupported_vector_types)]` on by default

warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:64:9
--> $DIR/simd-abi-checks-avx.rs:65:9
|
LL | f(g());
| ^^^^^^ function called here
@@ -20,7 +20,7 @@ LL | f(g());
= help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`)

warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:72:14
--> $DIR/simd-abi-checks-avx.rs:73:14
|
LL | gavx(favx());
| ^^^^^^ function called here
@@ -30,7 +30,7 @@ LL | gavx(favx());
= help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`)

warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:72:9
--> $DIR/simd-abi-checks-avx.rs:73:9
|
LL | gavx(favx());
| ^^^^^^^^^^^^ function called here
@@ -40,7 +40,7 @@ LL | gavx(favx());
= help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`)

warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:84:19
--> $DIR/simd-abi-checks-avx.rs:85:19
|
LL | w(Wrapper(g()));
| ^^^ function called here
@@ -50,7 +50,7 @@ LL | w(Wrapper(g()));
= help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`)

warning: this function call uses SIMD vector type `Wrapper` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:84:9
--> $DIR/simd-abi-checks-avx.rs:85:9
|
LL | w(Wrapper(g()));
| ^^^^^^^^^^^^^^^ function called here
@@ -60,7 +60,7 @@ LL | w(Wrapper(g()));
= help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`)

warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:100:9
--> $DIR/simd-abi-checks-avx.rs:101:9
|
LL | some_extern();
| ^^^^^^^^^^^^^ function called here
@@ -70,7 +70,7 @@ LL | some_extern();
= help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`)

warning: this function definition uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled
--> $DIR/simd-abi-checks-avx.rs:27:1
--> $DIR/simd-abi-checks-avx.rs:28:1
|
LL | unsafe extern "C" fn g() -> __m256 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
@@ -80,7 +80,7 @@ LL | unsafe extern "C" fn g() -> __m256 {
= help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`)

warning: this function definition uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled
--> $DIR/simd-abi-checks-avx.rs:21:1
--> $DIR/simd-abi-checks-avx.rs:22:1
|
LL | unsafe extern "C" fn f(_: __m256) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
@@ -90,7 +90,7 @@ LL | unsafe extern "C" fn f(_: __m256) {
= help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`)

warning: this function definition uses SIMD vector type `Wrapper` which (with the chosen ABI) requires the `avx` target feature, which is not enabled
--> $DIR/simd-abi-checks-avx.rs:15:1
--> $DIR/simd-abi-checks-avx.rs:16:1
|
LL | unsafe extern "C" fn w(_: Wrapper) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
@@ -100,7 +100,7 @@ LL | unsafe extern "C" fn w(_: Wrapper) {
= help: consider enabling it globally (`-C target-feature=+avx`) or locally (`#[target_feature(enable="avx")]`)

warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:57:8
--> $DIR/simd-abi-checks-avx.rs:58:8
|
LL | || g()
| ^^^ function called here
@@ -113,7 +113,7 @@ warning: 11 warnings emitted

Future incompatibility report: Future breakage diagnostic:
warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:64:11
--> $DIR/simd-abi-checks-avx.rs:65:11
|
LL | f(g());
| ^^^ function called here
@@ -125,7 +125,7 @@ LL | f(g());

Future breakage diagnostic:
warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:64:9
--> $DIR/simd-abi-checks-avx.rs:65:9
|
LL | f(g());
| ^^^^^^ function called here
@@ -137,7 +137,7 @@ LL | f(g());

Future breakage diagnostic:
warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:72:14
--> $DIR/simd-abi-checks-avx.rs:73:14
|
LL | gavx(favx());
| ^^^^^^ function called here
@@ -149,7 +149,7 @@ LL | gavx(favx());

Future breakage diagnostic:
warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:72:9
--> $DIR/simd-abi-checks-avx.rs:73:9
|
LL | gavx(favx());
| ^^^^^^^^^^^^ function called here
@@ -161,7 +161,7 @@ LL | gavx(favx());

Future breakage diagnostic:
warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:84:19
--> $DIR/simd-abi-checks-avx.rs:85:19
|
LL | w(Wrapper(g()));
| ^^^ function called here
@@ -173,7 +173,7 @@ LL | w(Wrapper(g()));

Future breakage diagnostic:
warning: this function call uses SIMD vector type `Wrapper` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:84:9
--> $DIR/simd-abi-checks-avx.rs:85:9
|
LL | w(Wrapper(g()));
| ^^^^^^^^^^^^^^^ function called here
@@ -185,7 +185,7 @@ LL | w(Wrapper(g()));

Future breakage diagnostic:
warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:100:9
--> $DIR/simd-abi-checks-avx.rs:101:9
|
LL | some_extern();
| ^^^^^^^^^^^^^ function called here
@@ -197,7 +197,7 @@ LL | some_extern();

Future breakage diagnostic:
warning: this function definition uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled
--> $DIR/simd-abi-checks-avx.rs:27:1
--> $DIR/simd-abi-checks-avx.rs:28:1
|
LL | unsafe extern "C" fn g() -> __m256 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
@@ -209,7 +209,7 @@ LL | unsafe extern "C" fn g() -> __m256 {

Future breakage diagnostic:
warning: this function definition uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled
--> $DIR/simd-abi-checks-avx.rs:21:1
--> $DIR/simd-abi-checks-avx.rs:22:1
|
LL | unsafe extern "C" fn f(_: __m256) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
@@ -221,7 +221,7 @@ LL | unsafe extern "C" fn f(_: __m256) {

Future breakage diagnostic:
warning: this function definition uses SIMD vector type `Wrapper` which (with the chosen ABI) requires the `avx` target feature, which is not enabled
--> $DIR/simd-abi-checks-avx.rs:15:1
--> $DIR/simd-abi-checks-avx.rs:16:1
|
LL | unsafe extern "C" fn w(_: Wrapper) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
@@ -233,7 +233,7 @@ LL | unsafe extern "C" fn w(_: Wrapper) {

Future breakage diagnostic:
warning: this function call uses SIMD vector type `std::arch::x86_64::__m256` which (with the chosen ABI) requires the `avx` target feature, which is not enabled in the caller
--> $DIR/simd-abi-checks-avx.rs:57:8
--> $DIR/simd-abi-checks-avx.rs:58:8
|
LL | || g()
| ^^^ function called here
2 changes: 1 addition & 1 deletion tests/ui/abi/simd-abi-checks-s390x.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ add-core-stubs
//@ revisions: z10 z13_no_vector z13_soft_float
//@ build-fail
//@[z10] compile-flags: --target s390x-unknown-linux-gnu
//@[z10] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z10
//@[z10] needs-llvm-components: systemz
//@[z13_no_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector
//@[z13_no_vector] needs-llvm-components: systemz
Loading