Skip to content

Commit 2bc7929

Browse files
committed
Auto merge of #114847 - nikic:update-llvm-12, r=cuviper
Update LLVM submodule Merge the current release/17.x branch. Fixes #114691. Fixes #114312. The test for the latter is taken from #114726.
2 parents 60713f4 + c12c084 commit 2bc7929

File tree

3 files changed

+67
-1
lines changed

3 files changed

+67
-1
lines changed

src/llvm-project

Submodule llvm-project updated 178 files

tests/codegen/issues/issue-114312.rs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// compile-flags: -O
2+
// min-llvm-version: 17
3+
// only-x86_64-unknown-linux-gnu
4+
5+
// We want to check that this function does not mis-optimize to loop jumping.
6+
7+
#![crate_type = "lib"]
8+
9+
#[repr(C)]
10+
pub enum Expr {
11+
Sum,
12+
// must have more than usize data
13+
Sub(usize, u8),
14+
}
15+
16+
#[no_mangle]
17+
pub extern "C" fn issue_114312(expr: Expr) {
18+
// CHECK-LABEL: @issue_114312(
19+
// CHECK-NOT: readonly
20+
// CHECK-SAME: byval
21+
// CHECK-NEXT: start:
22+
// CHECK-NEXT: ret void
23+
match expr {
24+
Expr::Sum => {}
25+
Expr::Sub(_, _) => issue_114312(Expr::Sum),
26+
}
27+
}

tests/ui/match/issue-114691.rs

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// run-pass
2+
3+
// This test used to be miscompiled by LLVM 17.
4+
#![allow(dead_code)]
5+
6+
enum Pass {
7+
Opaque {
8+
clear_color: [f32; 4],
9+
with_depth_pre_pass: bool,
10+
},
11+
Transparent,
12+
}
13+
14+
enum LoadOp {
15+
Clear,
16+
Load,
17+
}
18+
19+
#[inline(never)]
20+
fn check(x: Option<LoadOp>) {
21+
assert!(x.is_none());
22+
}
23+
24+
#[inline(never)]
25+
fn test(mode: Pass) {
26+
check(match mode {
27+
Pass::Opaque {
28+
with_depth_pre_pass: true,
29+
..
30+
}
31+
| Pass::Transparent => None,
32+
_ => Some(LoadOp::Clear),
33+
});
34+
}
35+
36+
fn main() {
37+
println!("Hello, world!");
38+
test(Pass::Transparent);
39+
}

0 commit comments

Comments
 (0)