Skip to content

Commit 1c9e231

Browse files
committed
check for exit statuses greater than 100
Since rust-lang/rust#52197, ICEs will fail with exit status 101. Compilation successes and failures will return 0 and 1, respectively. Fixes rust-lang#143.
1 parent 4ac3ddb commit 1c9e231

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

test.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
#!/bin/bash
22

3+
RUSTC=rustc
4+
35
for f in src/*
46
do
57
[[ -f $f ]] || continue;
68
echo "Testing $f:"
7-
# Compile the code, and if it passes exit with error code
8-
if rustc "$f" > /dev/null 2>&1; then
9+
# Compile the code, and if it exits with a code less than 101, exit with error
10+
# code.
11+
#
12+
# An ICE will cause error code 101. An abort or other signal will cause an
13+
# error code greater than 101.
14+
output=$($RUSTC --color=always "$f" 2>&1)
15+
if (( "$?" < 101 )); then
16+
echo "$output"
917
exit 1
1018
fi
1119
done
1220

1321
echo "Testing 21335"
14-
rustc - --out-dir=random_directory_that_does_not_exist/ --emit=llvm-ir <<< 'fn main(){}'
22+
$RUSTC - --out-dir=random_directory_that_does_not_exist/ --emit=llvm-ir <<< 'fn main(){}'
1523

1624
echo "Testing 16229"
1725
if bash 16229.sh > /dev/null 2>&1; then

0 commit comments

Comments
 (0)