tests: don't ignore compiler stderr in lib-defaults.rs

And also:

- Document test intent.
- Move under `link-native-libs/` instead.
This commit is contained in:
Jieyou Xu
2025-05-06 02:37:45 +08:00
parent 243c5a35e1
commit cbaa73beca
2 changed files with 17 additions and 15 deletions

View File

@@ -1,15 +0,0 @@
//@ run-pass
//@ dont-check-compiler-stderr (rust-lang/rust#54222)
//@ compile-flags: -lrust_test_helpers
#[link(name = "rust_test_helpers", kind = "static")]
extern "C" {
pub fn rust_dbg_extern_identity_u32(x: u32) -> u32;
}
fn main() {
unsafe {
rust_dbg_extern_identity_u32(42);
}
}

View File

@@ -0,0 +1,17 @@
//! By default, `-l NAME` without an explicit kind will default to dylib. However, if there's also
//! an `#[link(name = NAME, kind = KIND)]` attribute with an explicit `KIND`, it should override the
//! CLI flag. In particular, this should not result in any duplicate flag warnings from the linker.
//@ run-pass
//@ compile-flags: -lrust_test_helpers
#[link(name = "rust_test_helpers", kind = "static")]
extern "C" {
pub fn rust_dbg_extern_identity_u32(x: u32) -> u32;
}
fn main() {
unsafe {
rust_dbg_extern_identity_u32(42);
}
}