Skip to content

Commit 62ca87f

Browse files
committed
Add test for #114691
1 parent 64cc56b commit 62ca87f

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

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)