Skip to content

Commit dcb1460

Browse files
committed
update test backtrace test case for query system
1 parent 5c41569 commit dcb1460

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

tests/run-make/short-ice/check.sh

+12-6
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,27 @@ full=$(cat $TMPDIR/rust-test-2.log | wc -l)
88
rustc_query_count=$(cat $TMPDIR/rust-test-1.log | grep rustc_query_ | wc -l)
99
rustc_query_count_full=$(cat $TMPDIR/rust-test-2.log | grep rustc_query_ | wc -l)
1010

11+
begin_count=$(cat $TMPDIR/rust-test-2.log | grep __rust_begin_short_backtrace | wc -l)
12+
end_count=$(cat $TMPDIR/rust-test-2.log | grep __rust_end_short_backtrace | wc -l)
13+
1114
cat $TMPDIR/rust-test-1.log
1215
echo "====================="
1316
cat $TMPDIR/rust-test-2.log
17+
echo "====================="
1418

1519
echo "short backtrace: $short"
1620
echo "full backtrace: $full"
21+
echo "begin_count: $begin_count"
22+
echo "end_count : $end_count"
1723
echo "rustc_query_count: $rustc_query_count"
1824
echo "rustc_query_count_full: $rustc_query_count_full"
1925

20-
## check `rustc_query_count` to avoid to missing `__rust_end_short_backtrace`
21-
## 1 <= $rustc_query_count < $rustc_query_count_full
22-
## $rustc_query_count_full > 10
23-
if [ $full -gt $short ] &&
24-
[ $rustc_query_count -gt 1 ] &&
25-
[ $rustc_query_count -lt $rustc_query_count_full ] &&
26+
## backtraces to vary a bit depending on platform and configuration options,
27+
## here we make sure that the short backtrace of rustc_query is shorter than the full,
28+
## and marks are in pairs.
29+
if [ $short -lt $full ] &&
30+
[ $begin_count -eq $end_count ] &&
31+
[ $(($rustc_query_count + 10)) -lt $rustc_query_count_full ] &&
2632
[ $rustc_query_count_full -gt 10 ]; then
2733
exit 0
2834
else

tests/ui/panics/default-backtrace-ice.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ LL | fn main() { missing_ident; }
88
stack backtrace:
99
(end_short_backtrace)
1010
(begin_short_backtrace)
11+
(end_short_backtrace)
12+
(begin_short_backtrace)
1113

1214
error: the compiler unexpectedly panicked. this is a bug.
1315

0 commit comments

Comments
 (0)