File tree 2 files changed +11
-0
lines changed
tests/ui/link-native-libs/issue-70093
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
+
1
3
//@ run-pass
2
4
//@ compile-flags: -Zlink-directives=no
3
5
//@ ignore-fuchsia - missing __libc_start_main for some reason (#84733)
4
6
//@ ignore-cross-compile - default-linker-libraries=yes doesn't play well with cross compiling
5
7
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.
6
11
#[ link( name = "some-random-non-existent-library" , kind = "static" ) ]
7
12
extern "C" { }
8
13
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
+
1
4
//@ run-pass
2
5
//@ compile-flags: -Zlink-native-libraries=no -Cdefault-linker-libraries=yes
3
6
//@ ignore-fuchsia - missing __libc_start_main for some reason (#84733)
14
17
//@[msvc] compile-flags: -Clink-arg=msvcrt.lib
15
18
//@[msvc] only-msvc
16
19
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.
17
23
#[ link( name = "some-random-non-existent-library" , kind = "static" ) ]
18
24
extern "C" { }
19
25
You can’t perform that action at this time.
0 commit comments