Skip to content

Commit

Permalink
ci: Test -Z codegen-backend=cranelift
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Dec 1, 2023
1 parent 1a319c0 commit 7dbeb3f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
1 change: 0 additions & 1 deletion .github/.cspell/project-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ cinc
cirruslabs
clgr
clidr
clif
cmovae
cmovb
cmovge
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ jobs:
- rust: nightly
- rust: nightly
flags: -C panic=abort -Z panic_abort_tests
- rust: nightly
flags: -Z codegen-backend=cranelift
- rust: nightly
os: macos-latest
- rust: nightly
Expand All @@ -105,6 +107,9 @@ jobs:
target: aarch64-unknown-linux-gnu
- rust: nightly
target: aarch64-unknown-linux-gnu
- rust: nightly
target: aarch64-unknown-linux-gnu
flags: -Z codegen-backend=cranelift
- rust: nightly
target: aarch64_be-unknown-linux-gnu
- rust: stable
Expand Down Expand Up @@ -195,6 +200,9 @@ jobs:
target: riscv64gc-unknown-linux-gnu
- rust: nightly
target: riscv64gc-unknown-linux-gnu
- rust: nightly
target: riscv64gc-unknown-linux-gnu
flags: -Z codegen-backend=cranelift
- rust: nightly
target: s390x-unknown-linux-gnu
- rust: nightly-2023-05-09 # Rust 1.71, LLVM 16 (oldest version we can use asm_experimental_arch on this target)
Expand Down
2 changes: 1 addition & 1 deletion portable-atomic-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ alloc = []
# generic = []

[dependencies]
portable-atomic = { version = "1.3", path = "..", default-features = false, features = ["require-cas"] }
portable-atomic = { version = "1.5.1", path = "..", default-features = false, features = ["require-cas"] }

[lints]
workspace = true
16 changes: 13 additions & 3 deletions tools/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ target_lower="${target//-/_}"
target_lower="${target_lower//./_}"
target_upper=$(tr '[:lower:]' '[:upper:]' <<<"${target_lower}")
randomize_layout=' -Z randomize-layout'
cranelift=''
if [[ "${RUSTFLAGS:-}" =~ -Z( )?codegen-backend=cranelift ]]; then
cranelift='1'
rustup ${pre_args[@]+"${pre_args[@]}"} component add rustc-codegen-cranelift-preview &>/dev/null
# panic=unwind is not supported yet.
# https://github.com/rust-lang/rustc_codegen_cranelift#not-yet-supported
flags=' -C panic=abort -Z panic_abort_tests'
export RUSTFLAGS="${RUSTFLAGS:-}${flags}"
export RUSTDOCFLAGS="${RUSTDOCFLAGS:-}${flags}"
fi

case "${cmd}" in
build)
Expand Down Expand Up @@ -231,9 +241,9 @@ run() {
x_cargo test ${build_std[@]+"${build_std[@]}"} --release --tests "$@"
fi

case "$(basename "${cargo}")" in
cargo-clif | cargo-clif.exe) return ;; # LTO is not supported
esac
if [[ -n "${cranelift}" ]]; then
return # LTO is not supported
fi

# LTO + doctests is very slow on some platforms (probably related to the fact that they compile binaries for each example)
CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 \
Expand Down

0 comments on commit 7dbeb3f

Please sign in to comment.