]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: const-block: Add testcase
authorArthur Cohen <arthur.cohen@embecosm.com>
Tue, 15 Apr 2025 11:41:41 +0000 (13:41 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 5 Aug 2025 14:36:44 +0000 (16:36 +0200)
gcc/testsuite/ChangeLog:

* rust/execute/torture/const_block1.rs: New test.

gcc/testsuite/rust/execute/torture/const_block1.rs [new file with mode: 0644]

diff --git a/gcc/testsuite/rust/execute/torture/const_block1.rs b/gcc/testsuite/rust/execute/torture/const_block1.rs
new file mode 100644 (file)
index 0000000..eaf3432
--- /dev/null
@@ -0,0 +1,9 @@
+const X: i32 = const {
+    let a = 15;
+    let b = 14;
+    a + b
+};
+
+fn main() -> i32 {
+    X - 29
+}