@@ -630,6 +630,46 @@ fn any_debug() {
630
630
assert_eq ! ( x. downcast_ref:: <MyStruct >( ) , Some ( & MyStruct { x: 7 } ) ) ;
631
631
}
632
632
633
+ #[ test]
634
+ fn test_check_compiler_doesnt_build_llvm ( ) {
635
+ // Checking the stage 1 compiler uses the bootstrap compiler, and therefore
636
+ // should not need to build LLVM.
637
+ {
638
+ let config = configure_with_args (
639
+ & [ "check" , "compiler" , "--stage=1" ] ,
640
+ & [ TEST_TRIPLE_1 ] ,
641
+ & [ TEST_TRIPLE_1 ] ,
642
+ ) ;
643
+ let mut cache = run_build ( & config. paths . clone ( ) , config) ;
644
+
645
+ assert ! ( !cache. contains:: <llvm:: Llvm >( ) ) ;
646
+ }
647
+
648
+ // Checking the stage 1 library uses the stage 1 compiler, so it will need LLVM.
649
+ {
650
+ let config = configure_with_args (
651
+ & [ "check" , "library" , "--stage=1" ] ,
652
+ & [ TEST_TRIPLE_1 ] ,
653
+ & [ TEST_TRIPLE_1 ] ,
654
+ ) ;
655
+ let mut cache = run_build ( & config. paths . clone ( ) , config) ;
656
+
657
+ assert ! ( cache. contains:: <llvm:: Llvm >( ) ) ;
658
+ }
659
+
660
+ // Checking the stage 2 compiler uses the stage 1 compiler, so it will need LLVM.
661
+ {
662
+ let config = configure_with_args (
663
+ & [ "check" , "compiler" , "--stage=2" ] ,
664
+ & [ TEST_TRIPLE_1 ] ,
665
+ & [ TEST_TRIPLE_1 ] ,
666
+ ) ;
667
+ let mut cache = run_build ( & config. paths . clone ( ) , config) ;
668
+
669
+ assert ! ( cache. contains:: <llvm:: Llvm >( ) ) ;
670
+ }
671
+ }
672
+
633
673
/// These tests use insta for snapshot testing.
634
674
/// See bootstrap's README on how to bless the snapshots.
635
675
mod snapshot {
0 commit comments