File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
tests/ui/link-native-libs/issue-70093 Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 1+ // Ensure that `#[link]` attributes are entirely ignore when using `-Zlink-directives=no`.
2+
13//@ run-pass
24//@ compile-flags: -Zlink-directives=no
35//@ ignore-fuchsia - missing __libc_start_main for some reason (#84733)
46//@ ignore-cross-compile - default-linker-libraries=yes doesn't play well with cross compiling
57
8+ // Usually these `#[link]` attribute would cause `libsome-random-non-existent-library`
9+ // to be passed to the linker, causing it to fail because the file doesn't exist.
10+ // However, with -Zlink-directives=no, the `#[link]` is ignored.
611#[ link( name = "some-random-non-existent-library" , kind = "static" ) ]
712extern "C" { }
813
Original file line number Diff line number Diff line change 1+ // Ensure that rust does not pass native libraries to the linker when
2+ // `-Zlink-native-libraries=no` is used.
3+
14//@ run-pass
25//@ compile-flags: -Zlink-native-libraries=no -Cdefault-linker-libraries=yes
36//@ ignore-fuchsia - missing __libc_start_main for some reason (#84733)
1417//@[msvc] compile-flags: -Clink-arg=msvcrt.lib
1518//@[msvc] only-msvc
1619
20+ // Usually these `#[link]` attribute would cause `libsome-random-non-existent-library`
21+ // to be passed to the linker, causing it to fail because the file doesn't exist.
22+ // However, -Zlink-native-libraries=no disables that.
1723#[ link( name = "some-random-non-existent-library" , kind = "static" ) ]
1824extern "C" { }
1925
You can’t perform that action at this time.
0 commit comments