2024-12-31 02:25:35 +00:00
|
|
|
// Ensure that `#[link]` attributes are entirely ignore when using `-Zlink-directives=no`.
|
|
|
|
|
2020-03-18 02:10:56 +00:00
|
|
|
//@ run-pass
|
2023-02-04 23:07:41 +00:00
|
|
|
//@ compile-flags: -Zlink-directives=no
|
2021-04-30 04:02:05 +00:00
|
|
|
//@ ignore-fuchsia - missing __libc_start_main for some reason (#84733)
|
2022-04-12 13:00:44 +00:00
|
|
|
//@ ignore-cross-compile - default-linker-libraries=yes doesn't play well with cross compiling
|
2020-03-18 02:10:56 +00:00
|
|
|
|
2024-12-31 02:25:35 +00:00
|
|
|
// Usually these `#[link]` attribute would cause `libsome-random-non-existent-library`
|
|
|
|
// to be passed to the linker, causing it to fail because the file doesn't exist.
|
|
|
|
// However, with -Zlink-directives=no, the `#[link]` is ignored.
|
2020-03-18 02:10:56 +00:00
|
|
|
#[link(name = "some-random-non-existent-library", kind = "static")]
|
|
|
|
extern "C" {}
|
|
|
|
|
|
|
|
fn main() {}
|