Skip to content

Commit 6bc9f50

Browse files
committed
Run builtins-test-intrinsics when possible
Currently we only build this, but it is possible to run the binary. Change the CI script to do so here.
1 parent cdf8cab commit 6bc9f50

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

builtins-test-intrinsics/src/main.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,14 +650,23 @@ fn something_with_a_dtor(f: &dyn Fn()) {
650650

651651
#[no_mangle]
652652
#[cfg(not(thumb))]
653-
fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ffi::c_int {
653+
#[cfg(not(any(thumb, windows)))]
654+
extern "C" fn main(_argc: core::ffi::c_int, _argv: *const *const u8) -> core::ffi::c_int {
655+
run();
656+
0
657+
}
658+
659+
#[no_mangle]
660+
#[cfg(windows)]
661+
#[allow(non_snake_case)]
662+
extern "C" fn mainCRTStartup() -> core::ffi::c_int {
654663
run();
655664
0
656665
}
657666

658667
#[no_mangle]
659668
#[cfg(thumb)]
660-
pub fn _start() -> ! {
669+
extern "C" fn _start() -> ! {
661670
run();
662671
loop {}
663672
}

ci/run.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,21 @@ done
120120

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

123-
build_intrinsics_test() {
124-
cargo build --target "$target" -v --package builtins-test-intrinsics "$@"
123+
run_intrinsics_test() {
124+
if [ "${NO_STD:-}" = "1" ]; then
125+
cmd=build
126+
else
127+
cmd=run
128+
fi
129+
130+
cargo "$cmd" --target "$target" -v --package builtins-test-intrinsics "$@"
125131
}
126132

127133
# Verify that we haven't dropped any intrinsics/symbols
128-
build_intrinsics_test
129-
build_intrinsics_test --release
130-
build_intrinsics_test --features c
131-
build_intrinsics_test --features c --release
134+
run_intrinsics_test
135+
run_intrinsics_test --release
136+
run_intrinsics_test --features c
137+
run_intrinsics_test --features c --release
132138

133139
# Verify that there are no undefined symbols to `panic` within our
134140
# implementations

0 commit comments

Comments
 (0)