]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
const-block: Add testcase devel/rust/master
authorArthur Cohen <arthur.cohen@embecosm.com>
Tue, 15 Apr 2025 11:41:41 +0000 (13:41 +0200)
committerCohenArthur <arthur.cohen@embecosm.com>
Tue, 27 May 2025 11:18:07 +0000 (11:18 +0000)
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
+}