@@ -43,22 +43,17 @@ if [ "${TEST_VERBATIM:-}" = "1" ]; then
4343 --target " $target " --target-dir " $verb_path " --features c
4444fi
4545
46- declare -a rlib_paths
47-
4846# Set the `rlib_paths` global array to a list of all compiler-builtins rlibs
49- update_rlib_paths () {
47+ for_each_rlib () {
5048 if [ -d /builtins-target ]; then
5149 rlib_paths=( /builtins-target/" ${target} " /debug/deps/libcompiler_builtins-* .rlib )
5250 else
5351 rlib_paths=( target/" ${target} " /debug/deps/libcompiler_builtins-* .rlib )
5452 fi
55- }
5653
57- run_with_rlibs () {
58- if [ -d /builtins-target ]; then
59- rlib_paths=( /builtins-target/" ${target} " /debug/deps/libcompiler_builtins-* .rlib )
60- else
61- rlib_paths=( target/" ${target} " /debug/deps/libcompiler_builtins-* .rlib )
54+ if [ " ${# rlib_paths[@]} " -lt 1 ]; then
55+ echo " rlibs expected but not found"
56+ exit 1
6257 fi
6358
6459 " $@ " " ${rlib_paths[@]} "
@@ -67,7 +62,7 @@ run_with_rlibs() {
6762# Remove any existing artifacts from previous tests that don't set #![compiler_builtins]
6863# update_rlib_paths
6964# rm -f "${rlib_paths[@]}"
70- run_with_rlibs rm -f
65+ for_each_rlib rm -f
7166
7267cargo build --target " $target "
7368cargo build --target " $target " --release
@@ -78,9 +73,13 @@ cargo build --target "$target" --release --features no-asm
7873cargo build --target " $target " --features no-f16-f128
7974cargo build --target " $target " --release --features no-f16-f128
8075
76+
77+ symcheck=(cargo run -p symbol-check)
78+ [[ " $target " = * " wasm" * ]] && symcheck+=(--features wasm)
79+
8180# Look out for duplicated symbols when we include the compiler-rt (C) implementation
82- run_with_rlibs cargo run -p symbol-check -- check-duplicates
83- run_with_rlibs rm -f
81+ for_each_rlib " ${symcheck[@]} " -- check-duplicates
82+ for_each_rlib rm -f
8483
8584build_intrinsics_test () {
8685 cargo build --target " $target " -v --package builtins-test-intrinsics " $@ "
@@ -100,4 +99,4 @@ CARGO_PROFILE_RELEASE_LTO=true \
10099 cargo build --target " $target " --package builtins-test-intrinsics --release
101100
102101# Ensure no references to any symbols from core
103- run_with_rlibs cargo run -p symbol-check -- check-core-syms
102+ for_each_rlib " ${symcheck[@]} " -- check-core-syms
0 commit comments