mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-19 18:34:08 +00:00
Auto merge of #70582 - pnkfelix:update-llvm-to-fix-69841, r=cuviper
Fix #69841 by updating LLVM submodule. Fix #69841 by updating LLVM submodule. Includes regression test for issue 69841.
This commit is contained in:
commit
424c793925
@ -1 +1 @@
|
|||||||
Subproject commit 992e608cfc5d1c126a23c640222fd396a3bdeb9f
|
Subproject commit 130721d6f4e6cba3b910ccdf5e0aa62b9dffc95f
|
30
src/test/ui/issues/issue-69841.rs
Normal file
30
src/test/ui/issues/issue-69841.rs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// This is a regression test for issue rust-lang/rust#69841, which exposed an
|
||||||
|
// LLVM bug which needed a fix to be backported.
|
||||||
|
|
||||||
|
// run-pass
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let buffer = [49u8, 10];
|
||||||
|
let mut a : u64 = 0;
|
||||||
|
'read: loop {
|
||||||
|
for c in &buffer {
|
||||||
|
match c {
|
||||||
|
48..=57 => {
|
||||||
|
a*= 10;
|
||||||
|
a+= *c as u64 - 48;
|
||||||
|
}
|
||||||
|
10 => {
|
||||||
|
break 'read;
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
unsafe { std::hint::unreachable_unchecked() };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if a == 1 {
|
||||||
|
println!("What did you expect?");
|
||||||
|
} else {
|
||||||
|
panic!("this should be unreachable.");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user