tests: Convert linkage-attr test to cross-compiling and bless

This commit is contained in:
Jubilee Young
2025-06-12 11:34:45 -07:00
committed by Chris Denton
parent 8f0c09aa50
commit 9f50246741
2 changed files with 12 additions and 21 deletions
@@ -1,6 +1,14 @@
//@ only-x86_64
//@ only-windows
//@ add-core-stubs
//@ compile-flags: --target x86_64-pc-windows-msvc
//@ compile-flags: --crate-type lib --emit link
//@ needs-llvm-components: x86
#![no_core]
#![feature(no_core)]
extern crate minicore;
// It may seem weird this is a cross-platform-testable thing, since doesn't it test linkage?
// However the main thing we are testing is an *error*, so it works fine!
#[link(name = "foo", kind = "raw-dylib")]
extern "stdcall" {
//~^ WARN: calling convention not supported on this target
@@ -1,5 +1,5 @@
warning: use of calling convention not supported on this target
--> $DIR/unsupported-abi.rs:5:1
--> $DIR/unsupported-abi.rs:13:1
|
LL | / extern "stdcall" {
LL | |
@@ -15,27 +15,10 @@ LL | | }
= note: `#[warn(unsupported_calling_conventions)]` on by default
error: ABI not supported by `#[link(kind = "raw-dylib")]` on this architecture
--> $DIR/unsupported-abi.rs:8:5
--> $DIR/unsupported-abi.rs:16:5
|
LL | fn f(x: i32);
| ^^^^^^^^^^^^^
error: aborting due to 1 previous error; 1 warning emitted
Future incompatibility report: Future breakage diagnostic:
warning: use of calling convention not supported on this target
--> $DIR/unsupported-abi.rs:5:1
|
LL | / extern "stdcall" {
LL | |
LL | |
LL | | fn f(x: i32);
LL | |
LL | | }
| |_^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #137018 <https://github.com/rust-lang/rust/issues/137018>
= help: if you need `extern "stdcall"` on win32 and `extern "C"` everywhere else, use `extern "system"`
= note: `#[warn(unsupported_calling_conventions)]` on by default