aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2022-03-22 15:37:20 +0100
committerJakub Jelinek <jakub@redhat.com>2022-03-22 15:37:20 +0100
commitb6e33907ebe89361f8ddfb7481534cbf4a97f213 (patch)
tree410e68434055b2e8e928c55e96f4d7d3f79a2431
parent24ee43194a542768b987be5d8021ae4ba7bad7b5 (diff)
downloadgcc-b6e33907ebe89361f8ddfb7481534cbf4a97f213.zip
gcc-b6e33907ebe89361f8ddfb7481534cbf4a97f213.tar.gz
gcc-b6e33907ebe89361f8ddfb7481534cbf4a97f213.tar.bz2
testsuite: Add testcase for already fixed PR [PR102489]
This got broken with r12-3529 and fixed with r12-5255. 2022-03-22 Jakub Jelinek <jakub@redhat.com> PR c++/102489 * g++.dg/coroutines/pr102489.C: New test.
-rw-r--r--gcc/testsuite/g++.dg/coroutines/pr102489.C16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/coroutines/pr102489.C b/gcc/testsuite/g++.dg/coroutines/pr102489.C
new file mode 100644
index 0000000..0ef06da
--- /dev/null
+++ b/gcc/testsuite/g++.dg/coroutines/pr102489.C
@@ -0,0 +1,16 @@
+// PR c++/102489
+// { dg-do compile }
+// { dg-additional-options "-O" }
+
+#include <coroutine>
+
+struct footask {
+ struct promise_type {
+ std::suspend_never initial_suspend();
+ std::suspend_never final_suspend() noexcept;
+ void unhandled_exception();
+ void get_return_object();
+ };
+ std::suspend_always foo;
+ footask taskfun() { co_await foo; }
+};