aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-11-22 11:12:05 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-30 12:36:47 +0100
commitac501a75b263a7dd7fa437c01aae53d41e30a515 (patch)
treea5b10454adc51f51ed74de365f7b63c83220fccc
parent04b3089a47c5ccfb86b29a9c64157d5d4f755c1c (diff)
downloadgcc-ac501a75b263a7dd7fa437c01aae53d41e30a515.zip
gcc-ac501a75b263a7dd7fa437c01aae53d41e30a515.tar.gz
gcc-ac501a75b263a7dd7fa437c01aae53d41e30a515.tar.bz2
gccrs: Add a regression test for async const functions
Functions that are both async and const shall be rejected during the AST validation pass. This new test highlight this behavior. gcc/testsuite/ChangeLog: * rust/compile/const_async_function.rs: New test. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
-rw-r--r--gcc/testsuite/rust/compile/const_async_function.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/const_async_function.rs b/gcc/testsuite/rust/compile/const_async_function.rs
new file mode 100644
index 0000000..fb1c4dd
--- /dev/null
+++ b/gcc/testsuite/rust/compile/const_async_function.rs
@@ -0,0 +1,3 @@
+// { dg-additional-options "-frust-edition=2018" }
+const async fn weird_function() {}
+// { dg-error "functions cannot be both .const. and .async." "" { target *-*-* } .-1 }