about summary refs log tree commit diff
path: root/library/stdarch
diff options
context:
space:
mode:
authorDavid Wood <david.wood2@arm.com>2024-11-05 11:29:25 +0000
committerAmanieu d'Antras <amanieu@gmail.com>2024-11-07 06:08:33 +0800
commitaaad388be19a718f225e559fc33abcec24c0ed5b (patch)
treece33dacf60609b3ebf4cca676520974fa6fa2690 /library/stdarch
parentb08aea9ec02033b843acc6187a25c7405dc3d816 (diff)
ci: add debug testing
Previous changes in Rust and LLVM have caused stdarch to be broken in
debug, so add testing to ensure that this is caught.
Diffstat (limited to 'library/stdarch')
-rw-r--r--library/stdarch/.github/workflows/main.yml5
-rwxr-xr-xlibrary/stdarch/ci/run.sh28
2 files changed, 19 insertions, 14 deletions
diff --git a/library/stdarch/.github/workflows/main.yml b/library/stdarch/.github/workflows/main.yml
index b1cb0037ae7..d5751e03fe6 100644
--- a/library/stdarch/.github/workflows/main.yml
+++ b/library/stdarch/.github/workflows/main.yml
@@ -68,6 +68,9 @@ jobs:
     runs-on: ${{ matrix.os }}
     strategy:
       matrix:
+        profile:
+        - dev
+        - release
         target:
         # Dockers that are run through docker on linux
         - i686-unknown-linux-gnu
@@ -192,6 +195,8 @@ jobs:
     - run: cargo generate-lockfile
 
     # Configure some env vars based on matrix configuration
+    - run: echo "PROFILE=--profile=${{matrix.profile}}" >> $GITHUB_ENV
+      shell: bash
     - run: echo "NORUN=1" >> $GITHUB_ENV
       shell: bash
       if: matrix.norun != '' || startsWith(matrix.target, 'thumb') || matrix.target == 'nvptx64-nvidia-cuda'
diff --git a/library/stdarch/ci/run.sh b/library/stdarch/ci/run.sh
index a13e5963f82..eb42a0ddaa9 100755
--- a/library/stdarch/ci/run.sh
+++ b/library/stdarch/ci/run.sh
@@ -12,6 +12,7 @@ set -ex
 
 export RUSTFLAGS="${RUSTFLAGS} -D warnings -Z merge-functions=disabled "
 export HOST_RUSTFLAGS="${RUSTFLAGS}"
+export PROFILE="${PROFILE:="--profile=release"}"
 
 export STDARCH_DISABLE_DEDUP_GUARD=1
 
@@ -63,6 +64,7 @@ echo "FEATURES=${FEATURES}"
 echo "OBJDUMP=${OBJDUMP}"
 echo "STDARCH_DISABLE_ASSERT_INSTR=${STDARCH_DISABLE_ASSERT_INSTR}"
 echo "STDARCH_TEST_EVERYTHING=${STDARCH_TEST_EVERYTHING}"
+echo "PROFILE=${PROFILE}"
 
 cargo_test() {
     cmd="cargo"
@@ -101,19 +103,17 @@ STD_DETECT="--manifest-path=crates/std_detect/Cargo.toml"
 STDARCH_EXAMPLES="--manifest-path=examples/Cargo.toml"
 INTRINSIC_TEST="--manifest-path=crates/intrinsic-test/Cargo.toml"
 
-cargo_test "${CORE_ARCH} --release"
+cargo_test "${CORE_ARCH} ${PROFILE}"
 
 if [ "$NOSTD" != "1" ]; then
-    cargo_test "${STD_DETECT}"
-    cargo_test "${STD_DETECT} --release"
+    cargo_test "${STD_DETECT} ${PROFILE}"
 
     cargo_test "${STD_DETECT} --no-default-features"
     cargo_test "${STD_DETECT} --no-default-features --features=std_detect_file_io"
     cargo_test "${STD_DETECT} --no-default-features --features=std_detect_dlsym_getauxval"
     cargo_test "${STD_DETECT} --no-default-features --features=std_detect_dlsym_getauxval,std_detect_file_io"
 
-    cargo_test "${STDARCH_EXAMPLES}"
-    cargo_test "${STDARCH_EXAMPLES} --release"
+    cargo_test "${STDARCH_EXAMPLES} ${PROFILE}"
 fi
 
 # Test targets compiled with extra features.
@@ -121,26 +121,26 @@ case ${TARGET} in
     x86*)
         export STDARCH_DISABLE_ASSERT_INSTR=1
         export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+avx"
-        cargo_test "--release"
+        cargo_test "${PROFILE}"
         ;;
     # FIXME: don't build anymore
     #mips-*gnu* | mipsel-*gnu*)
     #    export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+msa,+fp64,+mips32r5"
-    #    cargo_test "--release"
+    #    cargo_test "${PROFILE}"
 	  #    ;;
     mips64*)
         export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+msa"
-        cargo_test "--release"
+        cargo_test "${PROFILE}"
 	      ;;
     powerpc64*)
         # We don't build the ppc 32-bit targets with these - these targets
         # are mostly unsupported for now.
         OLD_RUSTFLAGS="${RUSTFLAGS}"
         export RUSTFLAGS="${OLD_RUSTFLAGS} -C target-feature=+altivec"
-        cargo_test "--release"
+        cargo_test "${PROFILE}"
 
         export RUSTFLAGS="${OLD_RUSTFLAGS} -C target-feature=+vsx"
-        cargo_test "--release"
+        cargo_test "${PROFILE}"
         ;;
     *)
         ;;
@@ -152,14 +152,14 @@ if [ "${TARGET}" = "aarch64-unknown-linux-gnu" ]; then
         CPPFLAGS="-fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/" \
             RUSTFLAGS="$HOST_RUSTFLAGS" \
             RUST_LOG=warn \
-            cargo run ${INTRINSIC_TEST} --release --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner "${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER}" --cppcompiler "clang++-15" --skip crates/intrinsic-test/missing_aarch64.txt
+            cargo run ${INTRINSIC_TEST} "${PROFILE}" --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner "${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER}" --cppcompiler "clang++-15" --skip crates/intrinsic-test/missing_aarch64.txt
     )
 elif [ "${TARGET}" = "armv7-unknown-linux-gnueabihf" ]; then
     (
         CPPFLAGS="-fuse-ld=lld -I/usr/arm-linux-gnueabihf/include/ -I/usr/arm-linux-gnueabihf/include/c++/9/arm-linux-gnueabihf/" \
             RUSTFLAGS="$HOST_RUSTFLAGS" \
             RUST_LOG=warn \
-            cargo run ${INTRINSIC_TEST} --release --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner "${CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER}" --cppcompiler "clang++-15" --skip crates/intrinsic-test/missing_arm.txt --a32
+            cargo run ${INTRINSIC_TEST} "${PROFILE}" --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner "${CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER}" --cppcompiler "clang++-15" --skip crates/intrinsic-test/missing_arm.txt --a32
     )
 fi
 
@@ -167,7 +167,7 @@ if [ "$NORUN" != "1" ] && [ "$NOSTD" != 1 ]; then
     # Test examples
     (
         cd examples
-        cargo test --target "$TARGET"
-        echo test | cargo run --target "$TARGET" --release hex
+        cargo test --target "$TARGET" "${PROFILE}"
+        echo test | cargo run --target "$TARGET" "${PROFILE}" hex
     )
 fi