Skip to content

Commit 598a0a3

Browse files
committed
Auto merge of #114726 - DianQK:beta, r=cuviper
[beta] Update LLVM to resolve a miscompilation found in 114312. Related issue: #114312 . After the master updates the LLVM, we will add the same test cases. In the meantime, close the issue.
2 parents d1fa3e4 + e241551 commit 598a0a3

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

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-system-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+
}

0 commit comments

Comments
 (0)