@@ -726,6 +726,37 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no`
726
726
end
727
727
end
728
728
729
+ # Object file with multiple cpu targets
730
+ @testset " Object file for multiple microarchitectures" begin
731
+ julia_path = joinpath (Sys. BINDIR, Base. julia_exename ())
732
+ outputo_file = tempname ()
733
+ write (outputo_file, " 1" )
734
+ object_file = tempname () * " .o"
735
+
736
+ # This is to test that even with `pkgimages=no`, we can create object file
737
+ # with multiple cpu-targets
738
+ # The cmd is checked for `--object-o` as soon as it is run. So, to avoid long
739
+ # testing times, intentionally don't pass `--sysimage`; when we reach the
740
+ # corresponding error, we know that `check_cmdline` has already passed
741
+ let v = readchomperrors (` $julia_path
742
+ --cpu-target='native;native'
743
+ --output-o=$object_file $outputo_file
744
+ --pkgimages=no` )
745
+
746
+ @test v[1 ] == false
747
+ @test v[2 ] == " "
748
+ @test ! contains (v[3 ], " More than one command line CPU targets specified" )
749
+ @test v[3 ] == " ERROR: File \" boot.jl\" not found"
750
+ end
751
+
752
+ # This is to test that with `pkgimages=yes`, multiple CPU targets are parsed.
753
+ # We intentionally fail fast due to a lack of an `--output-o` flag.
754
+ let v = readchomperrors (` $julia_path --cpu-target='native;native' --pkgimages=yes` )
755
+ @test v[1 ] == false
756
+ @test v[2 ] == " "
757
+ @test contains (v[3 ], " More than one command line CPU targets specified" )
758
+ end
759
+ end
729
760
730
761
# Find the path of libjulia (or libjulia-debug, as the case may be)
731
762
# to use as a dummy shlib to open
0 commit comments