5 export RUSTFLAGS="-Zrun_dsymutil=no"
6 if [[ "$1" == "--release" ]]; then
7 export CHANNEL='release'
10 export CHANNEL='debug'
11 cargo build --bin cg_clif
15 source scripts/config.sh
16 export CG_CLIF_INCR_CACHE_DISABLED=1
17 RUSTC=$RUSTC" "$RUSTFLAGS" -L crate=target/out --out-dir target/out -Cdebuginfo=2"
20 rm -r target/out || true
23 echo "[BUILD] mini_core"
24 $RUSTC example/mini_core.rs --crate-name mini_core --crate-type lib,dylib --target $TARGET_TRIPLE
26 echo "[BUILD] example"
27 $RUSTC example/example.rs --crate-type lib --target $TARGET_TRIPLE
29 if [[ "$JIT_SUPPORTED" = "1" ]]; then
30 echo "[JIT] mini_core_hello_world"
31 CG_CLIF_JIT_ARGS="abc bcd" $RUSTC --jit example/mini_core_hello_world.rs --cfg jit --target $HOST_TRIPLE
33 echo "[JIT] mini_core_hello_world (skipped)"
36 echo "[AOT] mini_core_hello_world"
37 $RUSTC example/mini_core_hello_world.rs --crate-name mini_core_hello_world --crate-type bin -g --target $TARGET_TRIPLE
38 $RUN_WRAPPER ./target/out/mini_core_hello_world abc bcd
39 # (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
41 echo "[AOT] arbitrary_self_types_pointers_and_wrappers"
42 $RUSTC example/arbitrary_self_types_pointers_and_wrappers.rs --crate-name arbitrary_self_types_pointers_and_wrappers --crate-type bin --target $TARGET_TRIPLE
43 $RUN_WRAPPER ./target/out/arbitrary_self_types_pointers_and_wrappers
45 echo "[BUILD] sysroot"
46 time ./build_sysroot/build_sysroot.sh --release
48 echo "[AOT] alloc_example"
49 $RUSTC example/alloc_example.rs --crate-type bin --target $TARGET_TRIPLE
50 $RUN_WRAPPER ./target/out/alloc_example
52 if [[ "$JIT_SUPPORTED" = "1" ]]; then
53 echo "[JIT] std_example"
54 $RUSTC --jit example/std_example.rs --target $HOST_TRIPLE
56 echo "[JIT] std_example (skipped)"
59 echo "[AOT] dst_field_align"
60 # FIXME Re-add -Zmir-opt-level=2 once rust-lang/rust#67529 is fixed.
61 $RUSTC example/dst-field-align.rs --crate-name dst_field_align --crate-type bin --target $TARGET_TRIPLE
62 $RUN_WRAPPER ./target/out/dst_field_align || (echo $?; false)
64 echo "[AOT] std_example"
65 $RUSTC example/std_example.rs --crate-type bin --target $TARGET_TRIPLE
66 $RUN_WRAPPER ./target/out/std_example arg
68 echo "[AOT] subslice-patterns-const-eval"
69 $RUSTC example/subslice-patterns-const-eval.rs --crate-type bin -Cpanic=abort --target $TARGET_TRIPLE
70 $RUN_WRAPPER ./target/out/subslice-patterns-const-eval
72 echo "[AOT] track-caller-attribute"
73 $RUSTC example/track-caller-attribute.rs --crate-type bin -Cpanic=abort --target $TARGET_TRIPLE
74 $RUN_WRAPPER ./target/out/track-caller-attribute
76 echo "[AOT] mod_bench"
77 $RUSTC example/mod_bench.rs --crate-type bin --target $TARGET_TRIPLE
78 $RUN_WRAPPER ./target/out/mod_bench
81 rm -r ./target || true
82 ../cargo.sh test --workspace
85 pushd simple-raytracer
86 if [[ "$HOST_TRIPLE" = "$TARGET_TRIPLE" ]]; then
87 echo "[BENCH COMPILE] ebobby/simple-raytracer"
88 hyperfine --runs ${RUN_RUNS:-10} --warmup 1 --prepare "cargo clean" \
89 "RUSTC=rustc RUSTFLAGS='' cargo build" \
92 echo "[BENCH RUN] ebobby/simple-raytracer"
93 cp ./target/debug/main ./raytracer_cg_clif
94 hyperfine --runs ${RUN_RUNS:-10} ./raytracer_cg_llvm ./raytracer_cg_clif
96 echo "[BENCH COMPILE] ebobby/simple-raytracer (skipped)"
97 echo "[COMPILE] ebobby/simple-raytracer"
99 echo "[BENCH RUN] ebobby/simple-raytracer (skipped)"
103 pushd build_sysroot/sysroot_src/library/core/tests
104 echo "[TEST] libcore"
105 rm -r ./target || true
106 ../../../../../cargo.sh test
110 echo "[TEST] rust-lang/regex example shootout-regex-dna"
112 # Make sure `[codegen mono items] start` doesn't poison the diff
113 ../cargo.sh build --example shootout-regex-dna
114 cat examples/regexdna-input.txt | ../cargo.sh run --example shootout-regex-dna | grep -v "Spawned thread" > res.txt
115 diff -u res.txt examples/regexdna-output.txt
117 echo "[TEST] rust-lang/regex tests"
118 ../cargo.sh test --tests -- --exclude-should-panic --test-threads 1 -Zunstable-options