about summary refs log tree commit diff
path: root/tests/ui/mir/unreachable-loop-jump-threading.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/mir/unreachable-loop-jump-threading.rs')
-rw-r--r--tests/ui/mir/unreachable-loop-jump-threading.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/mir/unreachable-loop-jump-threading.rs b/tests/ui/mir/unreachable-loop-jump-threading.rs
new file mode 100644
index 00000000000..8403906bb5c
--- /dev/null
+++ b/tests/ui/mir/unreachable-loop-jump-threading.rs
@@ -0,0 +1,10 @@
+//@ build-pass
+//@ needs-rustc-debug-assertions
+//@ compile-flags: -Zmir-enable-passes=+GVN -Zmir-enable-passes=+JumpThreading --crate-type=lib
+
+pub fn fun(terminate: bool) {
+    while true {}
+    //~^ WARN denote infinite loops with `loop { ... }`
+
+    while !terminate {}
+}