Skip to content

Commit 81ab838

Browse files
tests: Rework abi_gpu_kernel feature gate test
Explicitly test it for relevant targets and check it errors on hosts.
1 parent cade8ff commit 81ab838

File tree

4 files changed

+208
-66
lines changed

4 files changed

+208
-66
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
2+
--> $DIR/feature-gate-abi_gpu_kernel.rs:16:8
3+
|
4+
LL | extern "gpu-kernel" fn f1(_: ()) {}
5+
| ^^^^^^^^^^^^
6+
|
7+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
8+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
9+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10+
11+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
12+
--> $DIR/feature-gate-abi_gpu_kernel.rs:21:12
13+
|
14+
LL | extern "gpu-kernel" fn m1(_: ());
15+
| ^^^^^^^^^^^^
16+
|
17+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
18+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
19+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
20+
21+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
22+
--> $DIR/feature-gate-abi_gpu_kernel.rs:24:12
23+
|
24+
LL | extern "gpu-kernel" fn dm1(_: ()) {}
25+
| ^^^^^^^^^^^^
26+
|
27+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
28+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
29+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
30+
31+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
32+
--> $DIR/feature-gate-abi_gpu_kernel.rs:32:12
33+
|
34+
LL | extern "gpu-kernel" fn m1(_: ()) {}
35+
| ^^^^^^^^^^^^
36+
|
37+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
38+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
39+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
40+
41+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
42+
--> $DIR/feature-gate-abi_gpu_kernel.rs:38:12
43+
|
44+
LL | extern "gpu-kernel" fn im1(_: ()) {}
45+
| ^^^^^^^^^^^^
46+
|
47+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
48+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
49+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
50+
51+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
52+
--> $DIR/feature-gate-abi_gpu_kernel.rs:43:18
53+
|
54+
LL | type A1 = extern "gpu-kernel" fn(_: ());
55+
| ^^^^^^^^^^^^
56+
|
57+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
58+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
59+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
60+
61+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
62+
--> $DIR/feature-gate-abi_gpu_kernel.rs:47:8
63+
|
64+
LL | extern "gpu-kernel" {}
65+
| ^^^^^^^^^^^^
66+
|
67+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
68+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
69+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
70+
71+
error: aborting due to 7 previous errors
72+
73+
For more information about this error, try `rustc --explain E0658`.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
2+
--> $DIR/feature-gate-abi_gpu_kernel.rs:16:8
3+
|
4+
LL | extern "gpu-kernel" fn f1(_: ()) {}
5+
| ^^^^^^^^^^^^
6+
17
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
2-
--> $DIR/feature-gate-abi_gpu_kernel.rs:11:8
8+
--> $DIR/feature-gate-abi_gpu_kernel.rs:16:8
39
|
410
LL | extern "gpu-kernel" fn f1(_: ()) {}
511
| ^^^^^^^^^^^^
@@ -8,8 +14,14 @@ LL | extern "gpu-kernel" fn f1(_: ()) {}
814
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
915
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1016

17+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
18+
--> $DIR/feature-gate-abi_gpu_kernel.rs:21:12
19+
|
20+
LL | extern "gpu-kernel" fn m1(_: ());
21+
| ^^^^^^^^^^^^
22+
1123
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
12-
--> $DIR/feature-gate-abi_gpu_kernel.rs:16:12
24+
--> $DIR/feature-gate-abi_gpu_kernel.rs:21:12
1325
|
1426
LL | extern "gpu-kernel" fn m1(_: ());
1527
| ^^^^^^^^^^^^
@@ -18,8 +30,14 @@ LL | extern "gpu-kernel" fn m1(_: ());
1830
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
1931
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
2032

33+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
34+
--> $DIR/feature-gate-abi_gpu_kernel.rs:24:12
35+
|
36+
LL | extern "gpu-kernel" fn dm1(_: ()) {}
37+
| ^^^^^^^^^^^^
38+
2139
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
22-
--> $DIR/feature-gate-abi_gpu_kernel.rs:18:12
40+
--> $DIR/feature-gate-abi_gpu_kernel.rs:24:12
2341
|
2442
LL | extern "gpu-kernel" fn dm1(_: ()) {}
2543
| ^^^^^^^^^^^^
@@ -28,8 +46,14 @@ LL | extern "gpu-kernel" fn dm1(_: ()) {}
2846
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
2947
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
3048

49+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
50+
--> $DIR/feature-gate-abi_gpu_kernel.rs:32:12
51+
|
52+
LL | extern "gpu-kernel" fn m1(_: ()) {}
53+
| ^^^^^^^^^^^^
54+
3155
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
32-
--> $DIR/feature-gate-abi_gpu_kernel.rs:26:12
56+
--> $DIR/feature-gate-abi_gpu_kernel.rs:32:12
3357
|
3458
LL | extern "gpu-kernel" fn m1(_: ()) {}
3559
| ^^^^^^^^^^^^
@@ -38,8 +62,14 @@ LL | extern "gpu-kernel" fn m1(_: ()) {}
3862
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
3963
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
4064

65+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
66+
--> $DIR/feature-gate-abi_gpu_kernel.rs:38:12
67+
|
68+
LL | extern "gpu-kernel" fn im1(_: ()) {}
69+
| ^^^^^^^^^^^^
70+
4171
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
42-
--> $DIR/feature-gate-abi_gpu_kernel.rs:32:12
72+
--> $DIR/feature-gate-abi_gpu_kernel.rs:38:12
4373
|
4474
LL | extern "gpu-kernel" fn im1(_: ()) {}
4575
| ^^^^^^^^^^^^
@@ -48,78 +78,39 @@ LL | extern "gpu-kernel" fn im1(_: ()) {}
4878
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
4979
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
5080

51-
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
52-
--> $DIR/feature-gate-abi_gpu_kernel.rs:37:18
81+
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
82+
--> $DIR/feature-gate-abi_gpu_kernel.rs:43:18
5383
|
5484
LL | type A1 = extern "gpu-kernel" fn(_: ());
5585
| ^^^^^^^^^^^^
56-
|
57-
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
58-
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
59-
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
6086

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

71-
warning: the calling convention "gpu-kernel" is not supported on this target
72-
--> $DIR/feature-gate-abi_gpu_kernel.rs:37:11
73-
|
74-
LL | type A1 = extern "gpu-kernel" fn(_: ());
75-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76-
|
77-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
78-
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
79-
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
80-
8197
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
82-
--> $DIR/feature-gate-abi_gpu_kernel.rs:42:1
98+
--> $DIR/feature-gate-abi_gpu_kernel.rs:47:8
8399
|
84100
LL | extern "gpu-kernel" {}
85-
| ^^^^^^^^^^^^^^^^^^^^^^
86-
87-
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
88-
--> $DIR/feature-gate-abi_gpu_kernel.rs:11:1
89-
|
90-
LL | extern "gpu-kernel" fn f1(_: ()) {}
91-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92-
93-
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
94-
--> $DIR/feature-gate-abi_gpu_kernel.rs:18:5
95-
|
96-
LL | extern "gpu-kernel" fn dm1(_: ()) {}
97-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
101+
| ^^^^^^^^^^^^
98102

99-
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
100-
--> $DIR/feature-gate-abi_gpu_kernel.rs:26:5
103+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
104+
--> $DIR/feature-gate-abi_gpu_kernel.rs:47:8
101105
|
102-
LL | extern "gpu-kernel" fn m1(_: ()) {}
103-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104-
105-
error[E0570]: `"gpu-kernel"` is not a supported ABI for the current target
106-
--> $DIR/feature-gate-abi_gpu_kernel.rs:32:5
106+
LL | extern "gpu-kernel" {}
107+
| ^^^^^^^^^^^^
107108
|
108-
LL | extern "gpu-kernel" fn im1(_: ()) {}
109-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
109+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
110+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
111+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
110112

111-
error: aborting due to 12 previous errors; 1 warning emitted
113+
error: aborting due to 14 previous errors
112114

113115
Some errors have detailed explanations: E0570, E0658.
114116
For more information about an error, try `rustc --explain E0570`.
115-
Future incompatibility report: Future breakage diagnostic:
116-
warning: the calling convention "gpu-kernel" is not supported on this target
117-
--> $DIR/feature-gate-abi_gpu_kernel.rs:37:11
118-
|
119-
LL | type A1 = extern "gpu-kernel" fn(_: ());
120-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
121-
|
122-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
123-
= note: for more information, see issue #130260 <https://github.com/rust-lang/rust/issues/130260>
124-
= note: `#[warn(unsupported_fn_ptr_calling_conventions)]` on by default
125-
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
2+
--> $DIR/feature-gate-abi_gpu_kernel.rs:16:8
3+
|
4+
LL | extern "gpu-kernel" fn f1(_: ()) {}
5+
| ^^^^^^^^^^^^
6+
|
7+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
8+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
9+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10+
11+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
12+
--> $DIR/feature-gate-abi_gpu_kernel.rs:21:12
13+
|
14+
LL | extern "gpu-kernel" fn m1(_: ());
15+
| ^^^^^^^^^^^^
16+
|
17+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
18+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
19+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
20+
21+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
22+
--> $DIR/feature-gate-abi_gpu_kernel.rs:24:12
23+
|
24+
LL | extern "gpu-kernel" fn dm1(_: ()) {}
25+
| ^^^^^^^^^^^^
26+
|
27+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
28+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
29+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
30+
31+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
32+
--> $DIR/feature-gate-abi_gpu_kernel.rs:32:12
33+
|
34+
LL | extern "gpu-kernel" fn m1(_: ()) {}
35+
| ^^^^^^^^^^^^
36+
|
37+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
38+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
39+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
40+
41+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
42+
--> $DIR/feature-gate-abi_gpu_kernel.rs:38:12
43+
|
44+
LL | extern "gpu-kernel" fn im1(_: ()) {}
45+
| ^^^^^^^^^^^^
46+
|
47+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
48+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
49+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
50+
51+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
52+
--> $DIR/feature-gate-abi_gpu_kernel.rs:43:18
53+
|
54+
LL | type A1 = extern "gpu-kernel" fn(_: ());
55+
| ^^^^^^^^^^^^
56+
|
57+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
58+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
59+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
60+
61+
error[E0658]: the extern "gpu-kernel" ABI is experimental and subject to change
62+
--> $DIR/feature-gate-abi_gpu_kernel.rs:47:8
63+
|
64+
LL | extern "gpu-kernel" {}
65+
| ^^^^^^^^^^^^
66+
|
67+
= note: see issue #135467 <https://github.com/rust-lang/rust/issues/135467> for more information
68+
= help: add `#![feature(abi_gpu_kernel)]` to the crate attributes to enable
69+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
70+
71+
error: aborting due to 7 previous errors
72+
73+
For more information about this error, try `rustc --explain E0658`.
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
//@ revisions: HOST AMDGPU NVPTX
12
//@ add-core-stubs
23
//@ compile-flags: --crate-type=rlib
4+
//@[AMDGPU] compile-flags: --target amdgcn-amd-amdhsa -Ctarget-cpu=gfx1100
5+
//@[AMDGPU] needs-llvm-components: amdgpu
6+
//@[NVPTX] compile-flags: --target nvptx64-nvidia-cuda
7+
//@[NVPTX] needs-llvm-components: nvptx
38

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

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

1419
// Methods in trait definition
1520
trait Tr {
1621
extern "gpu-kernel" fn m1(_: ()); //~ ERROR "gpu-kernel" ABI is experimental and subject to change
22+
//[HOST]~^ ERROR is not a supported ABI
1723

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

2228
struct S;
2329

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

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

3642
// Function pointer types
3743
type A1 = extern "gpu-kernel" fn(_: ()); //~ ERROR "gpu-kernel" ABI is experimental and subject to change
38-
//~^ WARN the calling convention "gpu-kernel" is not supported on this target
39-
//~^^ WARN this was previously accepted by the compiler but is being phased out
44+
//[HOST]~^ ERROR is not a supported ABI
4045

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

0 commit comments

Comments
 (0)