]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add a new regression test
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Tue, 10 Oct 2023 11:20:33 +0000 (13:20 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:09:16 +0000 (19:09 +0100)
Add a new test to highlight the fix made for #2660.

gcc/testsuite/ChangeLog:

* rust/compile/range_from_expr_for_loop.rs: New test.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/testsuite/rust/compile/range_from_expr_for_loop.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/compile/range_from_expr_for_loop.rs b/gcc/testsuite/rust/compile/range_from_expr_for_loop.rs
new file mode 100644 (file)
index 0000000..69b4b0c
--- /dev/null
@@ -0,0 +1,7 @@
+// { dg-additional-options "-frust-compile-until=ast" }
+fn main() {
+    for _ in 1.. {
+        break;
+    }
+    let i = 2;
+}