Skip to content

tests: Minicore extern "gpu-kernel" feature test #142273

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

Merged
Merged
Show file tree
Hide file tree
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
73 changes: 73 additions & 0 deletions tests/ui/feature-gates/feature-gate-abi_gpu_kernel.AMDGPU.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:16:8
|
LL | extern "gpu-kernel" fn f1(_: ()) {}
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:21:12
|
LL | extern "gpu-kernel" fn m1(_: ());
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:23:12
|
LL | extern "gpu-kernel" fn dm1(_: ()) {}
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:31:12
|
LL | extern "gpu-kernel" fn m1(_: ()) {}
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:37:12
|
LL | extern "gpu-kernel" fn im1(_: ()) {}
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:42:18
|
LL | type A1 = extern "gpu-kernel" fn(_: ());
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:47:8
|
LL | extern "gpu-kernel" {}
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error: aborting due to 7 previous errors

For more information about this error, try `rustc --explain E0658`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:11:8
--> $DIR/feature-gate-abi_gpu_kernel.rs:16:8
|
LL | extern "gpu-kernel" fn f1(_: ()) {}
| ^^^^^^^^^^^^
Expand All @@ -9,7 +9,7 @@ LL | extern "gpu-kernel" fn f1(_: ()) {}
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:16:12
--> $DIR/feature-gate-abi_gpu_kernel.rs:21:12
|
LL | extern "gpu-kernel" fn m1(_: ());
| ^^^^^^^^^^^^
Expand All @@ -19,7 +19,7 @@ LL | extern "gpu-kernel" fn m1(_: ());
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:18:12
--> $DIR/feature-gate-abi_gpu_kernel.rs:23:12
|
LL | extern "gpu-kernel" fn dm1(_: ()) {}
| ^^^^^^^^^^^^
Expand All @@ -29,7 +29,7 @@ LL | extern "gpu-kernel" fn dm1(_: ()) {}
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:26:12
--> $DIR/feature-gate-abi_gpu_kernel.rs:31:12
|
LL | extern "gpu-kernel" fn m1(_: ()) {}
| ^^^^^^^^^^^^
Expand All @@ -39,7 +39,7 @@ LL | extern "gpu-kernel" fn m1(_: ()) {}
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:32:12
--> $DIR/feature-gate-abi_gpu_kernel.rs:37:12
|
LL | extern "gpu-kernel" fn im1(_: ()) {}
| ^^^^^^^^^^^^
Expand All @@ -49,7 +49,7 @@ LL | extern "gpu-kernel" fn im1(_: ()) {}
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:37:18
--> $DIR/feature-gate-abi_gpu_kernel.rs:42:18
|
LL | type A1 = extern "gpu-kernel" fn(_: ());
| ^^^^^^^^^^^^
Expand All @@ -59,7 +59,7 @@ LL | type A1 = extern "gpu-kernel" fn(_: ());
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:42:8
--> $DIR/feature-gate-abi_gpu_kernel.rs:47:8
|
LL | extern "gpu-kernel" {}
| ^^^^^^^^^^^^
Expand All @@ -69,7 +69,7 @@ LL | extern "gpu-kernel" {}
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

warning: the calling convention "gpu-kernel" is not supported on this target
--> $DIR/feature-gate-abi_gpu_kernel.rs:37:11
--> $DIR/feature-gate-abi_gpu_kernel.rs:42:11
|
LL | type A1 = extern "gpu-kernel" fn(_: ());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -79,31 +79,31 @@ LL | type A1 = extern "gpu-kernel" fn(_: ());
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default

error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
--> $DIR/feature-gate-abi_gpu_kernel.rs:42:1
--> $DIR/feature-gate-abi_gpu_kernel.rs:47:1
|
LL | extern "gpu-kernel" {}
| ^^^^^^^^^^^^^^^^^^^^^^

error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
--> $DIR/feature-gate-abi_gpu_kernel.rs:11:1
--> $DIR/feature-gate-abi_gpu_kernel.rs:16:1
|
LL | extern "gpu-kernel" fn f1(_: ()) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
--> $DIR/feature-gate-abi_gpu_kernel.rs:18:5
--> $DIR/feature-gate-abi_gpu_kernel.rs:23:5
|
LL | extern "gpu-kernel" fn dm1(_: ()) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
--> $DIR/feature-gate-abi_gpu_kernel.rs:26:5
--> $DIR/feature-gate-abi_gpu_kernel.rs:31:5
|
LL | extern "gpu-kernel" fn m1(_: ()) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
--> $DIR/feature-gate-abi_gpu_kernel.rs:32:5
--> $DIR/feature-gate-abi_gpu_kernel.rs:37:5
|
LL | extern "gpu-kernel" fn im1(_: ()) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -114,7 +114,7 @@ Some errors have detailed explanations: E0570, E0658.
For more information about an error, try `rustc --explain E0570`.
Future incompatibility report: Future breakage diagnostic:
warning: the calling convention "gpu-kernel" is not supported on this target
--> $DIR/feature-gate-abi_gpu_kernel.rs:37:11
--> $DIR/feature-gate-abi_gpu_kernel.rs:42:11
|
LL | type A1 = extern "gpu-kernel" fn(_: ());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
73 changes: 73 additions & 0 deletions tests/ui/feature-gates/feature-gate-abi_gpu_kernel.NVPTX.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:16:8
|
LL | extern "gpu-kernel" fn f1(_: ()) {}
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:21:12
|
LL | extern "gpu-kernel" fn m1(_: ());
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:23:12
|
LL | extern "gpu-kernel" fn dm1(_: ()) {}
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:31:12
|
LL | extern "gpu-kernel" fn m1(_: ()) {}
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:37:12
|
LL | extern "gpu-kernel" fn im1(_: ()) {}
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:42:18
|
LL | type A1 = extern "gpu-kernel" fn(_: ());
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
--> $DIR/feature-gate-abi_gpu_kernel.rs:47:8
|
LL | extern "gpu-kernel" {}
| ^^^^^^^^^^^^
|
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error: aborting due to 7 previous errors

For more information about this error, try `rustc --explain E0658`.
19 changes: 12 additions & 7 deletions tests/ui/feature-gates/feature-gate-abi_gpu_kernel.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
//@ revisions: HOST AMDGPU NVPTX
//@ add-core-stubs
//@ compile-flags: --crate-type=rlib
//@[AMDGPU] compile-flags: --target amdgcn-amd-amdhsa -Ctarget-cpu=gfx1100
//@[AMDGPU] needs-llvm-components: amdgpu
//@[NVPTX] compile-flags: --target nvptx64-nvidia-cuda
//@[NVPTX] needs-llvm-components: nvptx

#![feature(no_core, lang_items)]
#![no_core]
Expand All @@ -9,35 +14,35 @@ use minicore::*;

// Functions
extern "gpu-kernel" fn f1(_: ()) {} //~ ERROR "gpu-kernel" ABI is experimental and subject to change
//~^ ERROR is not a supported ABI
//[HOST]~^ ERROR is not a supported ABI

// Methods in trait definition
trait Tr {
extern "gpu-kernel" fn m1(_: ()); //~ ERROR "gpu-kernel" ABI is experimental and subject to change

extern "gpu-kernel" fn dm1(_: ()) {} //~ ERROR "gpu-kernel" ABI is experimental and subject to change
//~^ ERROR is not a supported ABI
//[HOST]~^ ERROR is not a supported ABI
}

struct S;

// Methods in trait impl
impl Tr for S {
extern "gpu-kernel" fn m1(_: ()) {} //~ ERROR "gpu-kernel" ABI is experimental and subject to change
//~^ ERROR is not a supported ABI
//[HOST]~^ ERROR is not a supported ABI
}

// Methods in inherent impl
impl S {
extern "gpu-kernel" fn im1(_: ()) {} //~ ERROR "gpu-kernel" ABI is experimental and subject to change
//~^ ERROR is not a supported ABI
//[HOST]~^ ERROR is not a supported ABI
}

// Function pointer types
type A1 = extern "gpu-kernel" fn(_: ()); //~ ERROR "gpu-kernel" ABI is experimental and subject to change
//~^ WARN the calling convention "gpu-kernel" is not supported on this target
//~^^ WARN this was previously accepted by the compiler but is being phased out
//[HOST]~^ WARNING the calling convention "gpu-kernel" is not supported on this target [unsupported_fn_ptr_calling_conventions]
//[HOST]~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

// Foreign modules
extern "gpu-kernel" {} //~ ERROR "gpu-kernel" ABI is experimental and subject to change
//~^ ERROR is not a supported ABI
//[HOST]~^ ERROR is not a supported ABI
Loading