Skip to content

Commit cb6a560

Browse files
committed
ci: run mir-opt tests on PR CI also as 32-bit (for EMIT_MIR_FOR_EACH_BIT_WIDTH).
1 parent f4a96c1 commit cb6a560

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/ci/docker/x86_64-gnu-llvm-7/Dockerfile

+18-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FROM ubuntu:18.04
22

33
RUN apt-get update && apt-get install -y --no-install-recommends \
44
g++ \
5+
g++-arm-linux-gnueabi \
56
make \
67
file \
78
curl \
@@ -29,7 +30,23 @@ ENV RUST_CONFIGURE_ARGS \
2930
--enable-llvm-link-shared \
3031
--set rust.thin-lto-import-instr-limit=10
3132

32-
ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy && python2.7 ../x.py test src/tools/tidy
33+
ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy && \
34+
# Run the `mir-opt` tests again but this time for a 32-bit target.
35+
# This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
36+
# both 32-bit and 64-bit outputs updated by the PR author, before
37+
# the PR is approved and tested for merging.
38+
# It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
39+
# despite having different output on 32-bit vs 64-bit targets.
40+
#
41+
# HACK(eddyb) `armv5te` is used (not `i686`) to support older LLVM than LLVM 9:
42+
# https://github.com/rust-lang/compiler-builtins/pull/311#issuecomment-612270089.
43+
# This also requires `--pass=build` because we can't execute the tests
44+
# on the `x86_64` host when they're built as `armv5te` binaries.
45+
# (we're only interested in the MIR output, so this doesn't matter)
46+
python2.7 ../x.py test src/test/mir-opt --pass=build \
47+
--target=armv5te-unknown-linux-gnueabi && \
48+
# Run tidy at the very end, after all the other tests.
49+
python2.7 ../x.py test src/tools/tidy
3350

3451
# The purpose of this container isn't to test with debug assertions and
3552
# this is run on all PRs, so let's get speedier builds by disabling these extra

0 commit comments

Comments
 (0)