@@ -16,69 +16,85 @@ rm -r target/out || true
16
16
mkdir -p target/out/clif
17
17
18
18
echo " [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
20
20
21
21
echo " [BUILD] example"
22
- $RUSTC example/example.rs --crate-type lib
22
+ $RUSTC example/example.rs --crate-type lib --target $TARGET_TRIPLE
23
23
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
26
30
27
31
echo " [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
30
34
# (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
31
35
32
36
echo " [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
35
39
36
40
echo " [BUILD] sysroot"
37
41
time ./build_sysroot/build_sysroot.sh
38
42
39
43
echo " [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
42
46
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
45
53
46
54
echo " [AOT] dst_field_align"
47
55
# 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)
50
58
51
59
echo " [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
54
62
55
63
echo " [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
58
66
59
67
echo " [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
62
70
63
71
echo " [BUILD] mod_bench"
64
- $RUSTC example/mod_bench.rs --crate-type bin
72
+ $RUSTC example/mod_bench.rs --crate-type bin --target $TARGET_TRIPLE
65
73
66
74
# FIXME linker gives multiple definitions error on Linux
67
75
# echo "[BUILD] sysroot in release mode"
68
76
# ./build_sysroot/build_sysroot.sh --release
69
77
70
78
pushd 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" \
73
82
" RUSTFLAGS='' cargo build --target $TARGET_TRIPLE " \
74
83
" ../cargo.sh build"
75
84
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
79
94
popd
80
95
81
96
pushd build_sysroot/sysroot_src/src/libcore/tests
97
+ echo " [TEST] libcore"
82
98
rm -r ./target || true
83
99
../../../../../cargo.sh test
84
100
popd
0 commit comments