Skip to content

Commit 325f425

Browse files
authored
[RISCV] Add llvm-test-suite to RISC-V annotated builders (#376)
As noted in the inline TODO, it may be worth later changing this so the test suite is run immediately after stage1 as stage1 + llvm-test-suite can build and run very quickly, provided rapid feedback. Although the lit-on-qemu mechanism could be used to run the test suite under qemu-system, we instead run the test suite under qemu-user. This has the advantage of simplicity - the suite runs well in this mode and we don't have the same concerns about testing things that may not work under qemu-user (such as LLDB or sanitizers) as for the main llvm-project tests.
1 parent c0c44a6 commit 325f425

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

zorg/buildbot/builders/annotated/rise-riscv-build.sh

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ git -C llvm reset --hard "${LLVM_REVISION}"
5757
# We unconditionally clean (i.e. don't check BUILDBOT_CLOBBER=1) as the script
5858
# hasn't been tested without cleaning after each build.
5959
build_step "Cleaning last build"
60-
rm -rf stage1 stage2
60+
rm -rf stage1 stage2 llvm-test-suite-build
6161

6262
build_step "llvm-project cmake stage 1"
6363
cmake -G Ninja \
@@ -112,3 +112,34 @@ cmake --build stage2
112112

113113
build_step "llvm-project check-all"
114114
cmake --build stage2 --target check-all
115+
116+
# TODO: Evaluate running the test suite immediately after stage1 as it
117+
# executes very quickly and could provide rapid "fail fast" feedback.
118+
if [ ! -d llvm-test-suite ]; then
119+
build_step "Cloning llvm-test-suite repo"
120+
git clone --progress https://github.com/llvm/llvm-test-suite.git
121+
fi
122+
123+
build_step "Updating llvm-test-suite repo"
124+
git -C llvm-test-suite fetch origin
125+
git -C llvm-test-suite reset --hard origin/main
126+
127+
build_step "llvm-test-suite cmake"
128+
export QEMU_LD_PREFIX="$(pwd)/../rvsysroot"
129+
export QEMU_CPU="$BB_QEMU_CPU"
130+
cmake -G Ninja \
131+
--toolchain=$(pwd)/stage1-toolchain.cmake \
132+
-DCMAKE_BUILD_TYPE=Release \
133+
-DTEST_SUITE_LIT=$(pwd)/stage1/bin/llvm-lit \
134+
-DTEST_SUITE_LIT_FLAGS=-v \
135+
-DTEST_SUITE_COLLECT_CODE_SIZE=OFF \
136+
-DTEST_SUITE_COLLECT_COMPILE_TIME=OFF \
137+
-DTEST_SUITE_USER_MODE_EMULATION=ON \
138+
-S llvm-test-suite \
139+
-B llvm-test-suite-build
140+
141+
build_step "llvm-test-suite build"
142+
cmake --build llvm-test-suite-build
143+
144+
build_step "llvm-test-suite check"
145+
cmake --build llvm-test-suite-build --target check

0 commit comments

Comments
 (0)