File tree Expand file tree Collapse file tree 4 files changed +37
-16
lines changed
native-link-modifier-verbatim-linker
native-link-modifier-verbatim-rustc Expand file tree Collapse file tree 4 files changed +37
-16
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,6 @@ run-make/missing-crate-dependency/Makefile
142142run-make/mixing-libs/Makefile
143143run-make/msvc-opt-minsize/Makefile
144144run-make/native-link-modifier-bundle/Makefile
145- run-make/native-link-modifier-verbatim-linker/Makefile
146145run-make/native-link-modifier-whole-archive/Makefile
147146run-make/no-alloc-shim/Makefile
148147run-make/no-builtins-attribute/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // `verbatim` is a native link modifier that forces rustc to only accept libraries with
2+ // a specified name. This test checks that this modifier works as intended.
3+ // This test is the same as native-link-modifier-rustc, but without rlibs.
4+ // See https://github.com/rust-lang/rust/issues/99425
5+
6+ use run_make_support:: rustc;
7+
8+ fn main ( ) {
9+ // Verbatim allows for the specification of a precise name - in this case, the unconventional ".ext" extension.
10+ rustc ( )
11+ . input ( "local_native_dep.rs" )
12+ . crate_type ( "staticlib" )
13+ . output ( "local_some_strange_name.ext" )
14+ . run ( ) ;
15+ rustc ( ) . input ( "main.rs" ) . arg ( "-lstatic:+verbatim=local_some_strange_name.ext" ) . run ( ) ;
16+
17+ // This section voluntarily avoids using static_lib_name helpers to be verbatim.
18+ // With verbatim, even these common library names are refused - it wants local_native_dep without
19+ // any file extensions.
20+ rustc ( )
21+ . input ( "local_native_dep.rs" )
22+ . crate_type ( "staticlib" )
23+ . output ( "liblocal_native_dep.a" )
24+ . run ( ) ;
25+ rustc ( ) . input ( "local_native_dep.rs" ) . crate_type ( "staticlib" ) . output ( "local_native_dep.a" ) . run ( ) ;
26+ rustc ( )
27+ . input ( "local_native_dep.rs" )
28+ . crate_type ( "staticlib" )
29+ . output ( "local_native_dep.lib" )
30+ . run ( ) ;
31+ rustc ( )
32+ . input ( "main.rs" )
33+ . arg ( "-lstatic:+verbatim=local_native_dep" )
34+ . run_fail ( )
35+ . assert_stderr_contains ( "local_native_dep" ) ;
36+ }
Original file line number Diff line number Diff line change 11// `verbatim` is a native link modifier that forces rustc to only accept libraries with
22// a specified name. This test checks that this modifier works as intended.
3+ // This test is the same as native-link-modifier-linker, but with rlibs.
34// See https://github.com/rust-lang/rust/issues/99425
45
56use run_make_support:: rustc;
You can’t perform that action at this time.
0 commit comments