about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/run-pass/consts/const-labeled-break.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/run-pass/consts/const-labeled-break.rs b/src/test/run-pass/consts/const-labeled-break.rs
new file mode 100644
index 00000000000..9417159e6fb
--- /dev/null
+++ b/src/test/run-pass/consts/const-labeled-break.rs
@@ -0,0 +1,10 @@
+// Using labeled break in a while loop has caused an illegal instruction being
+// generated, and an ICE later.
+//
+// See https://github.com/rust-lang/rust/issues/51350 for more information.
+
+const CRASH: () = 'a: while break 'a {};
+
+fn main() {
+    println!("{:?}", CRASH);
+}