Hi

Where possible (i.e. where that doesn't alter the intent of a test) we
use a suspend_always as the final suspend and a test that the coroutine
was 'done' to check that the state machine had terminated correctly.

Sometimes, filed PRs have 'suspend_never' as the final suspend expression
and that needs to be changed to match the testsuite style.  This is one
I missed and means that the call to 'done()' on the handle is made to an
already-destructed coroutine.  Surprisngly, that  didn't actually trigger
a failure until glibc 2-32.

Fixed by changing the final suspend to be 'suspend_always’.

tested on x86_64-linux-gnu with valgrind (since the problem does not show
on most versions of glibc).
pushed to master,
thanks
Iain

gcc/testsuite/ChangeLog:

        PR c++/96504
        * g++.dg/coroutines/torture/pr95519-05-gro.C: Use suspend_always
        as the final suspend point so that we can check that the state
        machine has reached the expected point.
---
gcc/testsuite/g++.dg/coroutines/torture/pr95519-05-gro.C | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.dg/coroutines/torture/pr95519-05-gro.C b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-05-gro.C
index fbbce97ed17..2e7218371bc 100644
--- a/gcc/testsuite/g++.dg/coroutines/torture/pr95519-05-gro.C
+++ b/gcc/testsuite/g++.dg/coroutines/torture/pr95519-05-gro.C
@@ -5,7 +5,7 @@
struct pt_b
{
  std::suspend_always initial_suspend() const noexcept { return {}; }
-  std::suspend_never final_suspend() const noexcept { return {}; }
+  std::suspend_always final_suspend() const noexcept { return {}; }
  constexpr void return_void () noexcept {};
  constexpr void unhandled_exception() const noexcept {}
};
--
2.24.1

Reply via email to