summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/unreachable_diverging.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:42 +0000
commitcec1877e180393eba0f6ddb0cf97bf3a791631c7 (patch)
tree47b4dac2a9dd9a40c30c251b4d4a72d7ccf77e9f /tests/mir-opt/unreachable_diverging.rs
parentAdding debian version 1.74.1+dfsg1-1. (diff)
downloadrustc-cec1877e180393eba0f6ddb0cf97bf3a791631c7.tar.xz
rustc-cec1877e180393eba0f6ddb0cf97bf3a791631c7.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/mir-opt/unreachable_diverging.rs')
-rw-r--r--tests/mir-opt/unreachable_diverging.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/mir-opt/unreachable_diverging.rs b/tests/mir-opt/unreachable_diverging.rs
index b7d308b86..b1df6f852 100644
--- a/tests/mir-opt/unreachable_diverging.rs
+++ b/tests/mir-opt/unreachable_diverging.rs
@@ -1,4 +1,6 @@
+// unit-test: UnreachablePropagation
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+
pub enum Empty {}
fn empty() -> Option<Empty> {
@@ -11,6 +13,23 @@ fn loop_forever() {
// EMIT_MIR unreachable_diverging.main.UnreachablePropagation.diff
fn main() {
+ // CHECK-LABEL: fn main(
+ // CHECK: bb0: {
+ // CHECK: {{_.*}} = empty()
+ // CHECK: bb1: {
+ // CHECK: switchInt({{.*}}) -> [1: bb2, otherwise: bb6];
+ // CHECK: bb2: {
+ // CHECK: [[ne:_.*]] = Ne({{.*}}, const false);
+ // CHECK: assume(move [[ne]]);
+ // CHECK: goto -> bb3;
+ // CHECK: bb3: {
+ // CHECK: {{_.*}} = loop_forever()
+ // CHECK: bb4: {
+ // CHECK: unreachable;
+ // CHECK: bb5: {
+ // CHECK: unreachable;
+ // CHECK: bb6: {
+ // CHECK: return;
let x = true;
if let Some(bomb) = empty() {
if x {