@@ -16,69 +16,85 @@ rm -r target/out || true
1616mkdir -p target/out/clif
1717
1818echo " [BUILD] mini_core"
19- $RUSTC example/mini_core.rs --crate-name mini_core --crate-type lib,dylib
19+ $RUSTC example/mini_core.rs --crate-name mini_core --crate-type lib,dylib --target $TARGET_TRIPLE
2020
2121echo " [BUILD] example"
22- $RUSTC example/example.rs --crate-type lib
22+ $RUSTC example/example.rs --crate-type lib --target $TARGET_TRIPLE
2323
24- echo " [JIT] mini_core_hello_world"
25- CG_CLIF_JIT=1 CG_CLIF_JIT_ARGS=" abc bcd" $RUSTC --crate-type bin -Cprefer-dynamic example/mini_core_hello_world.rs --cfg jit
24+ if [[ " $HOST_TRIPLE " = " $TARGET_TRIPLE " ]]; then
25+ echo " [JIT] mini_core_hello_world"
26+ CG_CLIF_JIT=1 CG_CLIF_JIT_ARGS=" abc bcd" $RUSTC --crate-type bin -Cprefer-dynamic example/mini_core_hello_world.rs --cfg jit --target $HOST_TRIPLE
27+ else
28+ echo " [JIT] mini_core_hello_world (skipped)"
29+ fi
2630
2731echo " [AOT] mini_core_hello_world"
28- $RUSTC example/mini_core_hello_world.rs --crate-name mini_core_hello_world --crate-type bin -g
29- ./target/out/mini_core_hello_world abc bcd
32+ $RUSTC example/mini_core_hello_world.rs --crate-name mini_core_hello_world --crate-type bin -g --target $TARGET_TRIPLE
33+ $RUN_WRAPPER ./target/out/mini_core_hello_world abc bcd
3034# (echo "break set -n main"; echo "run"; sleep 1; echo "si -c 10"; sleep 1; echo "frame variable") | lldb -- ./target/out/mini_core_hello_world abc bcd
3135
3236echo " [AOT] arbitrary_self_types_pointers_and_wrappers"
33- $RUSTC example/arbitrary_self_types_pointers_and_wrappers.rs --crate-name arbitrary_self_types_pointers_and_wrappers --crate-type bin
34- ./target/out/arbitrary_self_types_pointers_and_wrappers
37+ $RUSTC example/arbitrary_self_types_pointers_and_wrappers.rs --crate-name arbitrary_self_types_pointers_and_wrappers --crate-type bin --target $TARGET_TRIPLE
38+ $RUN_WRAPPER ./target/out/arbitrary_self_types_pointers_and_wrappers
3539
3640echo " [BUILD] sysroot"
3741time ./build_sysroot/build_sysroot.sh
3842
3943echo " [AOT] alloc_example"
40- $RUSTC example/alloc_example.rs --crate-type bin
41- ./target/out/alloc_example
44+ $RUSTC example/alloc_example.rs --crate-type bin --target $TARGET_TRIPLE
45+ $RUN_WRAPPER ./target/out/alloc_example
4246
43- echo " [JIT] std_example"
44- CG_CLIF_JIT=1 $RUSTC --crate-type bin -Cprefer-dynamic example/std_example.rs
47+ if [[ " $HOST_TRIPLE " = " $TARGET_TRIPLE " ]]; then
48+ echo " [JIT] std_example"
49+ CG_CLIF_JIT=1 $RUSTC --crate-type bin -Cprefer-dynamic example/std_example.rs --target $HOST_TRIPLE
50+ else
51+ echo " [JIT] std_example (skipped)"
52+ fi
4553
4654echo " [AOT] dst_field_align"
4755# FIXME Re-add -Zmir-opt-level=2 once rust-lang/rust#67529 is fixed.
48- $RUSTC example/dst-field-align.rs --crate-name dst_field_align --crate-type bin
49- ./target/out/dst_field_align
56+ $RUSTC example/dst-field-align.rs --crate-name dst_field_align --crate-type bin --target $TARGET_TRIPLE
57+ $RUN_WRAPPER ./target/out/dst_field_align || (echo $? ; false)
5058
5159echo " [AOT] std_example"
52- $RUSTC example/std_example.rs --crate-type bin
53- ./target/out/std_example
60+ $RUSTC example/std_example.rs --crate-type bin --target $TARGET_TRIPLE
61+ $RUN_WRAPPER ./target/out/std_example --target $TARGET_TRIPLE
5462
5563echo " [AOT] subslice-patterns-const-eval"
56- $RUSTC example/subslice-patterns-const-eval.rs --crate-type bin -Cpanic=abort
57- ./target/out/subslice-patterns-const-eval
64+ $RUSTC example/subslice-patterns-const-eval.rs --crate-type bin -Cpanic=abort --target $TARGET_TRIPLE
65+ $RUN_WRAPPER ./target/out/subslice-patterns-const-eval
5866
5967echo " [AOT] track-caller-attribute"
60- $RUSTC example/track-caller-attribute.rs --crate-type bin -Cpanic=abort
61- ./target/out/track-caller-attribute
68+ $RUSTC example/track-caller-attribute.rs --crate-type bin -Cpanic=abort --target $TARGET_TRIPLE
69+ $RUN_WRAPPER ./target/out/track-caller-attribute
6270
6371echo " [BUILD] mod_bench"
64- $RUSTC example/mod_bench.rs --crate-type bin
72+ $RUSTC example/mod_bench.rs --crate-type bin --target $TARGET_TRIPLE
6573
6674# FIXME linker gives multiple definitions error on Linux
6775# echo "[BUILD] sysroot in release mode"
6876# ./build_sysroot/build_sysroot.sh --release
6977
7078pushd simple-raytracer
71- echo " [BENCH COMPILE] ebobby/simple-raytracer"
72- hyperfine --runs ${RUN_RUNS:- 10} --warmup 1 --prepare " rm -r target/*/debug || true" \
79+ if [[ " $HOST_TRIPLE " = " $TARGET_TRIPLE " ]]; then
80+ echo " [BENCH COMPILE] ebobby/simple-raytracer"
81+ hyperfine --runs ${RUN_RUNS:- 10} --warmup 1 --prepare " rm -r target/*/debug || true" \
7382 " RUSTFLAGS='' cargo build --target $TARGET_TRIPLE " \
7483 " ../cargo.sh build"
7584
76- echo " [BENCH RUN] ebobby/simple-raytracer"
77- cp ./target/* /debug/main ./raytracer_cg_clif
78- hyperfine --runs ${RUN_RUNS:- 10} ./raytracer_cg_llvm ./raytracer_cg_clif
85+ echo " [BENCH RUN] ebobby/simple-raytracer"
86+ cp ./target/* /debug/main ./raytracer_cg_clif
87+ hyperfine --runs ${RUN_RUNS:- 10} ./raytracer_cg_llvm ./raytracer_cg_clif
88+ else
89+ echo " [BENCH COMPILE] ebobby/simple-raytracer (skipped)"
90+ echo " [COMPILE] ebobby/simple-raytracer"
91+ ../cargo.sh build
92+ echo " [BENCH RUN] ebobby/simple-raytracer (skipped)"
93+ fi
7994popd
8095
8196pushd build_sysroot/sysroot_src/src/libcore/tests
97+ echo " [TEST] libcore"
8298rm -r ./target || true
8399../../../../../cargo.sh test
84100popd
0 commit comments