[gcc/devel/rust/master] const-block: Add testcase
Thomas Schwinge
tschwinge@gcc.gnu.org
Wed Jun 4 22:41:19 GMT 2025
https://gcc.gnu.org/g:7e42c1ee80f2b4836f81f546e8c1bf7ecca57210
commit 7e42c1ee80f2b4836f81f546e8c1bf7ecca57210
Author: Arthur Cohen <arthur.cohen@embecosm.com>
Date: Tue Apr 15 13:41:41 2025 +0200
const-block: Add testcase
gcc/testsuite/ChangeLog:
* rust/execute/torture/const_block1.rs: New test.
Diff:
---
gcc/testsuite/rust/execute/torture/const_block1.rs | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/gcc/testsuite/rust/execute/torture/const_block1.rs b/gcc/testsuite/rust/execute/torture/const_block1.rs
new file mode 100644
index 000000000000..eaf343249d13
--- /dev/null
+++ b/gcc/testsuite/rust/execute/torture/const_block1.rs
@@ -0,0 +1,9 @@
+const X: i32 = const {
+ let a = 15;
+ let b = 14;
+ a + b
+};
+
+fn main() -> i32 {
+ X - 29
+}
More information about the Gcc-cvs
mailing list