Skip to content

Commit 424c793

Browse files
committed
Auto merge of rust-lang#70582 - pnkfelix:update-llvm-to-fix-69841, r=cuviper
Fix rust-lang#69841 by updating LLVM submodule. Fix rust-lang#69841 by updating LLVM submodule. Includes regression test for issue 69841.
2 parents 548afdb + 0c4ad1f commit 424c793

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

src/test/ui/issues/issue-69841.rs

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// This is a regression test for issue rust-lang/rust#69841, which exposed an
2+
// LLVM bug which needed a fix to be backported.
3+
4+
// run-pass
5+
6+
fn main() {
7+
let buffer = [49u8, 10];
8+
let mut a : u64 = 0;
9+
'read: loop {
10+
for c in &buffer {
11+
match c {
12+
48..=57 => {
13+
a*= 10;
14+
a+= *c as u64 - 48;
15+
}
16+
10 => {
17+
break 'read;
18+
}
19+
_ => {
20+
unsafe { std::hint::unreachable_unchecked() };
21+
}
22+
}
23+
}
24+
}
25+
if a == 1 {
26+
println!("What did you expect?");
27+
} else {
28+
panic!("this should be unreachable.");
29+
}
30+
}

0 commit comments

Comments
 (0)