@@ -30,16 +30,23 @@ endgroup
3030
3131# Test
3232function run_tests {
33- if [ -n " ${MIRI_TEST_TARGET+exists } " ]; then
33+ if [ -n " ${MIRI_TEST_TARGET:- } " ]; then
3434 begingroup " Testing foreign architecture $MIRI_TEST_TARGET "
3535 else
3636 begingroup " Testing host architecture"
3737 fi
3838
3939 # # ui test suite
40- ./miri test
41- if [ -z " ${MIRI_TEST_TARGET+exists} " ]; then
42- # Host-only tests: running these on all targets is unlikely to catch more problems and would
40+ # On the host and on Linux, also stress-test the GC.
41+ if [ -z " ${MIRI_TEST_TARGET:- } " ] || [ " $HOST_TARGET " = x86_64-unknown-linux-gnu ]; then
42+ MIRIFLAGS=" ${MIRIFLAGS:- } -Zmiri-provenance-gc=1" ./miri test
43+ else
44+ ./miri test
45+ fi
46+
47+ # Host-only tests
48+ if [ -z " ${MIRI_TEST_TARGET:- } " ]; then
49+ # Running these on all targets is unlikely to catch more problems and would
4350 # cost a lot of CI time.
4451
4552 # Tests with optimizations (`-O` is what cargo passes, but crank MIR optimizations up all the
@@ -85,10 +92,11 @@ function run_tests {
8592}
8693
8794function run_tests_minimal {
88- if [ -n " ${MIRI_TEST_TARGET+exists } " ]; then
95+ if [ -n " ${MIRI_TEST_TARGET:- } " ]; then
8996 begingroup " Testing MINIMAL foreign architecture $MIRI_TEST_TARGET : only testing $@ "
9097 else
91- begingroup " Testing MINIMAL host architecture: only testing $@ "
98+ echo " run_tests_minimal requires MIRI_TEST_TARGET to be set"
99+ exit 1
92100 fi
93101
94102 ./miri test -- " $@ "
@@ -99,15 +107,20 @@ function run_tests_minimal {
99107 endgroup
100108}
101109
102- # host
110+ # # Main Testing Logic ##
111+
112+ # Host target.
103113run_tests
104114
115+ # Extra targets.
116+ # In particular, fully cover all tier 1 targets.
105117case $HOST_TARGET in
106118 x86_64-unknown-linux-gnu)
107119 MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
108120 MIRI_TEST_TARGET=aarch64-unknown-linux-gnu run_tests
109121 MIRI_TEST_TARGET=aarch64-apple-darwin run_tests
110122 MIRI_TEST_TARGET=i686-pc-windows-gnu run_tests
123+ # Some targets are only partially supported.
111124 MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple pthread-threadname libc-getentropy libc-getrandom libc-misc libc-fs atomic env align
112125 MIRI_TEST_TARGET=i686-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple pthread-threadname libc-getentropy libc-getrandom libc-misc libc-fs atomic env align
113126 MIRI_TEST_TARGET=aarch64-linux-android run_tests_minimal hello integer vec panic/panic
0 commit comments