Add regression test
This commit is contained in:
parent
731c6dcb60
commit
b07a470d1a
@ -0,0 +1,25 @@
|
||||
// MIR for `main` after AbortUnwindingCalls
|
||||
|
||||
fn main() -> () {
|
||||
let mut _0: (); // return place in scope 0 at $DIR/issue_104451_unwindable_intrinsics.rs:+0:11: +0:11
|
||||
let mut _1: !; // in scope 0 at $DIR/issue_104451_unwindable_intrinsics.rs:+2:9: +2:62
|
||||
let mut _2: (); // in scope 0 at $DIR/issue_104451_unwindable_intrinsics.rs:+2:45: +2:47
|
||||
scope 1 {
|
||||
}
|
||||
|
||||
bb0: {
|
||||
StorageLive(_1); // scope 1 at $DIR/issue_104451_unwindable_intrinsics.rs:+2:9: +2:62
|
||||
StorageLive(_2); // scope 1 at $DIR/issue_104451_unwindable_intrinsics.rs:+2:45: +2:47
|
||||
_2 = (); // scope 1 at $DIR/issue_104451_unwindable_intrinsics.rs:+2:45: +2:47
|
||||
_1 = const_eval_select::<(), fn() -> ! {ow_ct}, fn() -> ! {ow_ct}, !>(move _2, ow_ct, ow_ct); // scope 1 at $DIR/issue_104451_unwindable_intrinsics.rs:+2:9: +2:62
|
||||
// mir::Constant
|
||||
// + span: $DIR/issue_104451_unwindable_intrinsics.rs:8:9: 8:44
|
||||
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn((), fn() -> ! {ow_ct}, fn() -> ! {ow_ct}) -> ! {const_eval_select::<(), fn() -> ! {ow_ct}, fn() -> ! {ow_ct}, !>}, val: Value(<ZST>) }
|
||||
// mir::Constant
|
||||
// + span: $DIR/issue_104451_unwindable_intrinsics.rs:8:49: 8:54
|
||||
// + literal: Const { ty: fn() -> ! {ow_ct}, val: Value(<ZST>) }
|
||||
// mir::Constant
|
||||
// + span: $DIR/issue_104451_unwindable_intrinsics.rs:8:56: 8:61
|
||||
// + literal: Const { ty: fn() -> ! {ow_ct}, val: Value(<ZST>) }
|
||||
}
|
||||
}
|
14
tests/mir-opt/issue_104451_unwindable_intrinsics.rs
Normal file
14
tests/mir-opt/issue_104451_unwindable_intrinsics.rs
Normal file
@ -0,0 +1,14 @@
|
||||
// Check that `UnwindAction::Unreachable` is not generated for unwindable intrinsics.
|
||||
// ignore-wasm32 compiled with panic=abort by default
|
||||
#![feature(core_intrinsics)]
|
||||
|
||||
// EMIT_MIR issue_104451_unwindable_intrinsics.main.AbortUnwindingCalls.after.mir
|
||||
fn main() {
|
||||
unsafe {
|
||||
core::intrinsics::const_eval_select((), ow_ct, ow_ct)
|
||||
}
|
||||
}
|
||||
|
||||
const fn ow_ct() -> ! {
|
||||
panic!();
|
||||
}
|
Loading…
Reference in New Issue
Block a user