Skip to content

Commit 961bac0

Browse files
committed
Add cross-compilation tool test
1 parent b14323a commit 961bac0

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/bootstrap/src/core/builder/tests.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,35 @@ mod snapshot {
780780
);
781781
}
782782

783+
#[test]
784+
fn build_compiler_tools_cross() {
785+
let ctx = TestCtx::new();
786+
insta::assert_snapshot!(
787+
ctx
788+
.config("build")
789+
.stage(2)
790+
.args(&["--set", "rust.lld=true", "--set", "rust.llvm-bitcode-linker=true"])
791+
.hosts(&[TEST_TRIPLE_1])
792+
.render_steps(), @r"
793+
[build] llvm <host>
794+
[build] rustc 0 <host> -> rustc 1 <host>
795+
[build] rustc 0 <host> -> LldWrapper 1 <host>
796+
[build] rustc 1 <host> -> LlvmBitcodeLinker 2 <host>
797+
[build] rustc 1 <host> -> std 1 <host>
798+
[build] rustc 1 <host> -> rustc 2 <host>
799+
[build] rustc 1 <host> -> LldWrapper 2 <host>
800+
[build] rustc 2 <host> -> LlvmBitcodeLinker 3 <host>
801+
[build] rustc 1 <host> -> std 1 <target1>
802+
[build] rustc 2 <host> -> std 2 <target1>
803+
[build] llvm <target1>
804+
[build] rustc 1 <host> -> rustc 2 <target1>
805+
[build] rustc 1 <host> -> LldWrapper 2 <target1>
806+
[build] rustc 2 <target1> -> LlvmBitcodeLinker 3 <target1>
807+
[build] rustdoc 1 <target1>
808+
"
809+
);
810+
}
811+
783812
#[test]
784813
fn build_library_no_explicit_stage() {
785814
let ctx = TestCtx::new();

0 commit comments

Comments
 (0)