Skip to content

Commit 034f7f0

Browse files
committed
test(codegen): Add regression test for issue #152340
1 parent 6314bd7 commit 034f7f0

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//@ only-x86_64
2+
//@ check-pass
3+
//
4+
// Regression test for <https://github.com/rust-lang/rust/issues/152340>.
5+
6+
#![allow(dead_code)]
7+
8+
#[target_feature(enable = "sse2")]
9+
const fn foo() {}
10+
11+
// DefKind::Const
12+
const _: () = unsafe {
13+
let _: unsafe fn() = foo;
14+
};
15+
16+
// DefKind::AssocConst
17+
struct S;
18+
impl S {
19+
const C: () = unsafe {
20+
let _: unsafe fn() = foo;
21+
};
22+
}
23+
24+
// DefKind::InlineConst
25+
fn bar() {
26+
let _ = const {
27+
unsafe {
28+
let _: unsafe fn() = foo;
29+
}
30+
};
31+
}
32+
33+
fn main() {}

0 commit comments

Comments
 (0)