File tree Expand file tree Collapse file tree 3 files changed +41
-21
lines changed
tests/run-make/raw-dylib-cross-compilation Expand file tree Collapse file tree 3 files changed +41
-21
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,6 @@ run-make/profile/Makefile
136136run-make/prune-link-args/Makefile
137137run-make/raw-dylib-alt-calling-convention/Makefile
138138run-make/raw-dylib-c/Makefile
139- run-make/raw-dylib-cross-compilation/Makefile
140139run-make/raw-dylib-custom-dlltool/Makefile
141140run-make/raw-dylib-import-name-type/Makefile
142141run-make/raw-dylib-inline-cross-dylib/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // When cross-compiling using `raw-dylib`, rustc would try to fetch some
2+ // very specific `dlltool` to complete the cross-compilation (such as `i686-w64-mingw32-dlltool`)
3+ // when Windows only calls it `dlltool`. This test performs some cross-compilation in a
4+ // way that previously failed due to this bug, and checks that it succeeds.
5+ // See https://github.com/rust-lang/rust/pull/108355
6+
7+ //@ ignore-i686-pc-windows-msvc
8+ // Reason: dlltool on this distribution is unable to produce x64 binaries
9+ //@ needs-dlltool
10+ // Reason: this is the utility being checked by this test
11+
12+ use run_make_support:: { llvm_objdump, rust_lib_name, rustc} ;
13+
14+ fn main ( ) {
15+ // Build as x86 and make sure that we have x86 objects only.
16+ rustc ( )
17+ . crate_type ( "lib" )
18+ . crate_name ( "i686_raw_dylib_test" )
19+ . target ( "i686-pc-windows-gnu" )
20+ . input ( "lib.rs" )
21+ . run ( ) ;
22+ llvm_objdump ( )
23+ . arg ( "-a" )
24+ . input ( rust_lib_name ( "i686_raw_dylib_test" ) )
25+ . run ( )
26+ . assert_stdout_contains ( "file format coff-i386" )
27+ . assert_stdout_not_contains ( "file format coff-x86-64" ) ;
28+ // Build as x64 and make sure that we have x64 objects only.
29+ rustc ( )
30+ . crate_type ( "lib" )
31+ . crate_name ( "x64_raw_dylib_test" )
32+ . target ( "x86-64-pc-windows-gnu" )
33+ . input ( "lib.rs" )
34+ . run ( ) ;
35+ llvm_objdump ( )
36+ . arg ( "-a" )
37+ . input ( rust_lib_name ( "i686_raw_dylib_test" ) )
38+ . run ( )
39+ . assert_stdout_not_contains ( "file format coff-i386" )
40+ . assert_stdout_contains ( "file format coff-x86-64" ) ;
41+ }
You can’t perform that action at this time.
0 commit comments