4 # Determine configuration
5 export RUSTFLAGS="-D warnings"
6 export CARGO_INCREMENTAL=0
7 export CARGO_EXTRA_FLAGS="--all-features"
10 echo "Build and install miri"
11 ./miri build --all-targets --locked
12 ./miri install # implicitly locked
17 if [ -n "${MIRI_TEST_TARGET+exists}" ]; then
18 echo "Testing foreign architecture $MIRI_TEST_TARGET"
20 echo "Testing host architecture"
24 if [ -z "${MIRI_TEST_TARGET+exists}" ]; then
25 # Only for host architecture: tests with optimizations (`-O` is what cargo passes, but crank MIR
26 # optimizations up all the way).
27 # Optimizations change diagnostics (mostly backtraces), so we don't check them
28 MIRIFLAGS="-O -Zmir-opt-level=4" MIRI_SKIP_UI_CHECKS=1 ./miri test --locked
31 # On Windows, there is always "python", not "python3" or "python2".
32 if command -v python3 > /dev/null; then
38 # "miri test" has built the sysroot for us, now this should pass without
39 # any interactive questions.
40 ${PYTHON} test-cargo-miri/run-test.py
48 x86_64-unknown-linux-gnu)
49 MIRI_TEST_TARGET=i686-unknown-linux-gnu run_tests
50 MIRI_TEST_TARGET=aarch64-apple-darwin run_tests
51 MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
54 MIRI_TEST_TARGET=mips64-unknown-linux-gnuabi64 run_tests # big-endian architecture
55 MIRI_TEST_TARGET=x86_64-pc-windows-msvc run_tests
58 MIRI_TEST_TARGET=x86_64-unknown-linux-gnu run_tests
61 echo "FATAL: unknown OS"