- 
                Notifications
    
You must be signed in to change notification settings  - Fork 301
 
          CI: Separate intrinsic-test from the other CI tests
          #1941
        
          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
          
     Merged
      
      
            folkertdev
  merged 4 commits into
  rust-lang:master
from
madhav-madhusoodanan:intrinsic-test-ci-modification
  
      
      
   
  Oct 25, 2025 
      
    
  
     Merged
                    Changes from 1 commit
      Commits
    
    
            Show all changes
          
          
            4 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      0545cbe
              
                feat: separate `intrinsic-test` from the other CI pipelines
              
              
                madhav-madhusoodanan 9d6f824
              
                chore: removing unused definitions or commented functionality in
              
              
                madhav-madhusoodanan 24dd9a9
              
                feat: melding targets and include for `intrinsic-test` CI step
              
              
                madhav-madhusoodanan 9d7cb2a
              
                simplify intrinsic test matrix
              
              
                folkertdev File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #!/usr/bin/env sh | ||
| 
     | 
||
| # Small script to run tests for a target (or all targets) inside all the | ||
| # respective docker images. | ||
| 
     | 
||
| set -ex | ||
| 
     | 
||
| if [ $# -lt 1 ]; then | ||
| >&2 echo "Usage: $0 <TARGET>" | ||
| exit 1 | ||
| fi | ||
| 
     | 
||
| run() { | ||
| # Set the linker that is used for the host (e.g. when compiling a build.rs) | ||
| # This overrides any configuration in e.g. `.cargo/config.toml`, which will | ||
| # probably not work within the docker container. | ||
| HOST_LINKER="CARGO_TARGET_$(rustc --print host-tuple | tr '[:lower:]-' '[:upper:]_')_LINKER" | ||
| 
     | 
||
| # Prevent `Read-only file system (os error 30)`. | ||
| cargo generate-lockfile | ||
| 
     | 
||
| echo "Building docker container for TARGET=${1}" | ||
| docker build -t stdarch -f "ci/docker/${1}/Dockerfile" ci/ | ||
| mkdir -p target c_programs rust_programs | ||
| echo "Running docker" | ||
| # shellcheck disable=SC2016 | ||
| docker run \ | ||
| --rm \ | ||
| --user "$(id -u)":"$(id -g)" \ | ||
| --env CARGO_HOME=/cargo \ | ||
| --env CARGO_TARGET_DIR=/checkout/target \ | ||
| --env TARGET="${1}" \ | ||
| --env "${HOST_LINKER}"="cc" \ | ||
| --env STDARCH_TEST_EVERYTHING \ | ||
| --env STDARCH_DISABLE_ASSERT_INSTR \ | ||
| --env NOSTD \ | ||
| --env NORUN \ | ||
| --env RUSTFLAGS \ | ||
| --env CARGO_UNSTABLE_BUILD_STD \ | ||
| --volume "${HOME}/.cargo":/cargo \ | ||
| --volume "$(rustc --print sysroot)":/rust:ro \ | ||
| --volume "$(pwd)":/checkout:ro \ | ||
| --volume "$(pwd)"/target:/checkout/target \ | ||
| --volume "$(pwd)"/c_programs:/checkout/c_programs \ | ||
| --volume "$(pwd)"/rust_programs:/checkout/rust_programs \ | ||
| --init \ | ||
| --workdir /checkout \ | ||
| --privileged \ | ||
| stdarch \ | ||
| sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec ci/intrinsic-test.sh ${1}" | ||
| } | ||
| 
     | 
||
| if [ -z "$1" ]; then | ||
| >&2 echo "No target specified!" | ||
| exit 1 | ||
| else | ||
| run "${1}" | ||
| fi | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| #!/usr/bin/env sh | ||
| 
     | 
||
| set -ex | ||
| 
     | 
||
| : "${TARGET?The TARGET environment variable must be set.}" | ||
| 
     | 
||
| # Tests are all super fast anyway, and they fault often enough on travis that | ||
| # having only one thread increases debuggability to be worth it. | ||
| #export RUST_BACKTRACE=full | ||
| #export RUST_TEST_NOCAPTURE=1 | ||
| #export RUST_TEST_THREADS=1 | ||
                
      
                  madhav-madhusoodanan marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| export RUSTFLAGS="${RUSTFLAGS} -D warnings -Z merge-functions=disabled -Z verify-llvm-ir" | ||
| export HOST_RUSTFLAGS="${RUSTFLAGS}" | ||
| export PROFILE="${PROFILE:="--profile=release"}" | ||
| 
     | 
||
| case ${TARGET} in | ||
| # On 32-bit use a static relocation model which avoids some extra | ||
| # instructions when dealing with static data, notably allowing some | ||
| # instruction assertion checks to pass below the 20 instruction limit. If | ||
| # this is the default, dynamic, then too many instructions are generated | ||
| # when we assert the instruction for a function and it causes tests to fail. | ||
| i686-* | i586-*) | ||
| export RUSTFLAGS="${RUSTFLAGS} -C relocation-model=static" | ||
| ;; | ||
| # Some x86_64 targets enable by default more features beyond SSE2, | ||
| # which cause some instruction assertion checks to fail. | ||
| x86_64-*) | ||
| export RUSTFLAGS="${RUSTFLAGS} -C target-feature=-sse3" | ||
| ;; | ||
| #Unoptimized build uses fast-isel which breaks with msa | ||
| mips-* | mipsel-*) | ||
| export RUSTFLAGS="${RUSTFLAGS} -C llvm-args=-fast-isel=false" | ||
| ;; | ||
| armv7-*eabihf | thumbv7-*eabihf) | ||
| export RUSTFLAGS="${RUSTFLAGS} -Ctarget-feature=+neon" | ||
| ;; | ||
| # Some of our test dependencies use the deprecated `gcc` crates which | ||
| # doesn't detect RISC-V compilers automatically, so do it manually here. | ||
| riscv*) | ||
| export RUSTFLAGS="${RUSTFLAGS} -Ctarget-feature=+zk,+zks,+zbb,+zbc" | ||
| ;; | ||
| esac | ||
| 
     | 
||
| echo "RUSTFLAGS=${RUSTFLAGS}" | ||
| echo "OBJDUMP=${OBJDUMP}" | ||
| echo "STDARCH_DISABLE_ASSERT_INSTR=${STDARCH_DISABLE_ASSERT_INSTR}" | ||
| echo "STDARCH_TEST_EVERYTHING=${STDARCH_TEST_EVERYTHING}" | ||
| echo "STDARCH_TEST_SKIP_FEATURE=${STDARCH_TEST_SKIP_FEATURE}" | ||
| echo "STDARCH_TEST_SKIP_FUNCTION=${STDARCH_TEST_SKIP_FUNCTION}" | ||
                
      
                  madhav-madhusoodanan marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| echo "PROFILE=${PROFILE}" | ||
| 
     | 
||
| INTRINSIC_TEST="--manifest-path=crates/intrinsic-test/Cargo.toml" | ||
| 
     | 
||
| # Test targets compiled with extra features. | ||
| case ${TARGET} in | ||
| 
     | 
||
| x86_64* | i686*) | ||
| export STDARCH_DISABLE_ASSERT_INSTR=1 | ||
| ;; | ||
                
      
                  madhav-madhusoodanan marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| 
     | 
||
| # Setup aarch64 & armv7 specific variables, the runner, along with some | ||
| # tests to skip | ||
| aarch64-unknown-linux-gnu*) | ||
| TEST_CPPFLAGS="-fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/" | ||
| TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_aarch64.txt | ||
| TEST_CXX_COMPILER="clang++" | ||
| TEST_RUNNER="${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER}" | ||
| ;; | ||
| 
     | 
||
| aarch64_be-unknown-linux-gnu*) | ||
| TEST_CPPFLAGS="-fuse-ld=lld" | ||
| TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_aarch64.txt | ||
| TEST_CXX_COMPILER="clang++" | ||
| TEST_RUNNER="${CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_RUNNER}" | ||
| ;; | ||
| 
     | 
||
| armv7-unknown-linux-gnueabihf*) | ||
| TEST_CPPFLAGS="-fuse-ld=lld -I/usr/arm-linux-gnueabihf/include/ -I/usr/arm-linux-gnueabihf/include/c++/9/arm-linux-gnueabihf/" | ||
| TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_arm.txt | ||
| TEST_CXX_COMPILER="clang++" | ||
| TEST_RUNNER="${CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER}" | ||
| ;; | ||
| *) | ||
| ;; | ||
| 
     | 
||
| esac | ||
| 
     | 
||
| # Arm specific | ||
| case "${TARGET}" in | ||
| aarch64-unknown-linux-gnu*|armv7-unknown-linux-gnueabihf*) | ||
| CPPFLAGS="${TEST_CPPFLAGS}" RUSTFLAGS="${HOST_RUSTFLAGS}" RUST_LOG=warn \ | ||
| cargo run "${INTRINSIC_TEST}" "${PROFILE}" \ | ||
| --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json \ | ||
| --runner "${TEST_RUNNER}" \ | ||
| --cppcompiler "${TEST_CXX_COMPILER}" \ | ||
| --skip "${TEST_SKIP_INTRINSICS}" \ | ||
| --target "${TARGET}" | ||
| ;; | ||
| 
     | 
||
| aarch64_be-unknown-linux-gnu*) | ||
| CPPFLAGS="${TEST_CPPFLAGS}" RUSTFLAGS="${HOST_RUSTFLAGS}" RUST_LOG=warn \ | ||
| cargo run "${INTRINSIC_TEST}" "${PROFILE}" \ | ||
| --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json \ | ||
| --runner "${TEST_RUNNER}" \ | ||
| --cppcompiler "${TEST_CXX_COMPILER}" \ | ||
| --skip "${TEST_SKIP_INTRINSICS}" \ | ||
| --target "${TARGET}" \ | ||
| --linker "${CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_LINKER}" \ | ||
| --cxx-toolchain-dir "${AARCH64_BE_TOOLCHAIN}" | ||
| ;; | ||
| *) | ||
| ;; | ||
| esac | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.