Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run builtins-test-intrinsics when possible #804

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions builtins-test-intrinsics/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
#![no_std]
#![no_main]

// Ensure this `compiler_builtins` gets used, rather than the version injected from the sysroot.
extern crate compiler_builtins;
extern crate panic_handler;

#[cfg(all(not(thumb), not(windows), not(target_arch = "wasm32")))]
Expand Down Expand Up @@ -592,7 +594,8 @@ fn run() {
bb(floatunsitf(bb(2)));
bb(floatuntidf(bb(2)));
bb(floatuntisf(bb(2)));
#[cfg(f128_enabled)]
// FIXME(windows): segfault on Windows
#[cfg(all(f128_enabled, not(windows)))]
bb(floatuntitf(bb(2)));
#[cfg(f128_enabled)]
bb(gttf(bb(2.), bb(2.)));
Expand Down Expand Up @@ -650,14 +653,14 @@ fn something_with_a_dtor(f: &dyn Fn()) {

#[no_mangle]
#[cfg(not(thumb))]
fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ffi::c_int {
extern "C" fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ffi::c_int {
run();
0
}

#[no_mangle]
#[cfg(thumb)]
pub fn _start() -> ! {
extern "C" fn _start() -> ! {
run();
loop {}
}
Expand Down
18 changes: 12 additions & 6 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,21 @@ done

rm -f "${rlib_paths[@]}"

build_intrinsics_test() {
cargo build --target "$target" -v --package builtins-test-intrinsics "$@"
run_intrinsics_test() {
if [ "${NO_STD:-}" = "1" ]; then
cmd=build
else
cmd=run
fi

cargo "$cmd" --target "$target" -v --package builtins-test-intrinsics "$@"
}

# Verify that we haven't dropped any intrinsics/symbols
build_intrinsics_test
build_intrinsics_test --release
build_intrinsics_test --features c
build_intrinsics_test --features c --release
run_intrinsics_test
run_intrinsics_test --release
run_intrinsics_test --features c
run_intrinsics_test --features c --release

# Verify that there are no undefined symbols to `panic` within our
# implementations
Expand Down
Loading