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