6 export CG_CLIF_INCR_CACHE_DISABLED
=1
7 MY_RUSTC
="$RUSTC $RUSTFLAGS -L crate=target/out --out-dir target/out -Cdebuginfo=2"
9 function no_sysroot_tests
() {
10 echo "[BUILD] mini_core"
11 $MY_RUSTC example
/mini_core.rs
--crate-name mini_core
--crate-type lib
,dylib
--target "$TARGET_TRIPLE"
13 echo "[BUILD] example"
14 $MY_RUSTC example
/example.rs
--crate-type lib
--target "$TARGET_TRIPLE"
16 if [[ "$JIT_SUPPORTED" = "1" ]]; then
17 echo "[JIT] mini_core_hello_world"
18 CG_CLIF_JIT_ARGS
="abc bcd" $MY_RUSTC --jit example
/mini_core_hello_world.rs
--cfg jit
--target "$HOST_TRIPLE"
20 echo "[JIT] mini_core_hello_world (skipped)"
23 echo "[AOT] mini_core_hello_world"
24 $MY_RUSTC example
/mini_core_hello_world.rs
--crate-name mini_core_hello_world
--crate-type bin
-g --target "$TARGET_TRIPLE"
25 $RUN_WRAPPER .
/target
/out
/mini_core_hello_world abc bcd
26 # (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
28 echo "[AOT] arbitrary_self_types_pointers_and_wrappers"
29 $MY_RUSTC example
/arbitrary_self_types_pointers_and_wrappers.rs
--crate-name arbitrary_self_types_pointers_and_wrappers
--crate-type bin
--target "$TARGET_TRIPLE"
30 $RUN_WRAPPER .
/target
/out
/arbitrary_self_types_pointers_and_wrappers
33 function base_sysroot_tests
() {
34 echo "[AOT] alloc_example"
35 $MY_RUSTC example
/alloc_example.rs
--crate-type bin
--target "$TARGET_TRIPLE"
36 $RUN_WRAPPER .
/target
/out
/alloc_example
38 if [[ "$JIT_SUPPORTED" = "1" ]]; then
39 echo "[JIT] std_example"
40 $MY_RUSTC --jit example
/std_example.rs
--target "$HOST_TRIPLE"
42 echo "[JIT] std_example (skipped)"
45 echo "[AOT] dst_field_align"
46 # FIXME Re-add -Zmir-opt-level=2 once rust-lang/rust#67529 is fixed.
47 $MY_RUSTC example
/dst-field-align.rs
--crate-name dst_field_align
--crate-type bin
--target "$TARGET_TRIPLE"
48 $RUN_WRAPPER .
/target
/out
/dst_field_align ||
(echo $?
; false
)
50 echo "[AOT] std_example"
51 $MY_RUSTC example
/std_example.rs
--crate-type bin
--target "$TARGET_TRIPLE"
52 $RUN_WRAPPER .
/target
/out
/std_example arg
54 echo "[AOT] subslice-patterns-const-eval"
55 $MY_RUSTC example
/subslice-patterns-const-eval.rs
--crate-type bin
-Cpanic=abort
--target "$TARGET_TRIPLE"
56 $RUN_WRAPPER .
/target
/out
/subslice-patterns-const-eval
58 echo "[AOT] track-caller-attribute"
59 $MY_RUSTC example
/track-caller-attribute.rs
--crate-type bin
-Cpanic=abort
--target "$TARGET_TRIPLE"
60 $RUN_WRAPPER .
/target
/out
/track-caller-attribute
62 echo "[AOT] mod_bench"
63 $MY_RUSTC example
/mod_bench.rs
--crate-type bin
--target "$TARGET_TRIPLE"
64 $RUN_WRAPPER .
/target
/out
/mod_bench
67 rm -r .
/target || true
68 ..
/build
/cargo.sh
test --workspace
72 function extended_sysroot_tests
() {
73 pushd simple-raytracer
74 if [[ "$HOST_TRIPLE" = "$TARGET_TRIPLE" ]]; then
75 echo "[BENCH COMPILE] ebobby/simple-raytracer"
76 hyperfine
--runs "${RUN_RUNS:-10}" --warmup 1 --prepare "cargo clean" \
77 "RUSTC=rustc RUSTFLAGS='' cargo build" \
78 "../build/cargo.sh build"
80 echo "[BENCH RUN] ebobby/simple-raytracer"
81 cp .
/target
/debug
/main .
/raytracer_cg_clif
82 hyperfine
--runs "${RUN_RUNS:-10}" .
/raytracer_cg_llvm .
/raytracer_cg_clif
84 echo "[BENCH COMPILE] ebobby/simple-raytracer (skipped)"
85 echo "[COMPILE] ebobby/simple-raytracer"
87 echo "[BENCH RUN] ebobby/simple-raytracer (skipped)"
91 pushd build_sysroot
/sysroot_src
/library
/core
/tests
93 rm -r .
/target || true
94 ..
/..
/..
/..
/..
/build
/cargo.sh
test
98 echo "[TEST] rust-lang/regex example shootout-regex-dna"
99 ..
/build
/cargo.sh clean
100 # Make sure `[codegen mono items] start` doesn't poison the diff
101 ..
/build
/cargo.sh build
--example shootout-regex-dna
102 cat examples
/regexdna-input.txt | ..
/build
/cargo.sh run
--example shootout-regex-dna |
grep -v "Spawned thread" > res.txt
103 diff -u res.txt examples
/regexdna-output.txt
105 echo "[TEST] rust-lang/regex tests"
106 ..
/build
/cargo.sh
test --tests -- --exclude-should-panic --test-threads 1 -Zunstable-options -q
118 extended_sysroot_tests
121 echo "unknown test suite"