Auto merge of #83030 - nikic:update-llvm, r=nagisa
Update llvm-project submodule Fixes #82833. Fixes #82859. Probably also `fixes` #83025. This also merges in the current upstream 12.x branch. r? `@nagisa`
This commit is contained in:
commit
215ebc364e
@ -1 +1 @@
|
|||||||
Subproject commit 5f958e150d377e608d2f1f208b86110218d5da3c
|
Subproject commit 62a1ddde22c267249eda72184520a21ad2052f0b
|
17
src/test/ui/issues/issue-82833-slice-miscompile.rs
Normal file
17
src/test/ui/issues/issue-82833-slice-miscompile.rs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// run-pass
|
||||||
|
// compile-flags: -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Copt-level=0 -Cdebuginfo=2
|
||||||
|
// ignore-tidy-linelength
|
||||||
|
|
||||||
|
// Make sure LLVM does not miscompile this.
|
||||||
|
|
||||||
|
fn make_string(ch: char) -> String {
|
||||||
|
let mut bytes = [0u8; 4];
|
||||||
|
ch.encode_utf8(&mut bytes).into()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let ch = '😃';
|
||||||
|
dbg!(ch);
|
||||||
|
let string = make_string(ch);
|
||||||
|
dbg!(string);
|
||||||
|
}
|
19
src/test/ui/issues/issue-82859-slice-miscompile.rs
Normal file
19
src/test/ui/issues/issue-82859-slice-miscompile.rs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// run-pass
|
||||||
|
// compile-flags: -Copt-level=0 -Cdebuginfo=2
|
||||||
|
|
||||||
|
// Make sure LLVM does not miscompile this.
|
||||||
|
|
||||||
|
fn indirect_get_slice() -> &'static [usize] {
|
||||||
|
&[]
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
fn get_slice() -> &'static [usize] {
|
||||||
|
let ret = indirect_get_slice();
|
||||||
|
ret
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let output = get_slice().len();
|
||||||
|
assert_eq!(output, 0);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user