https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110827
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2023-07-27
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
CC| |iains at gcc dot gnu.org
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm seeing all code properly instrumented. The coverage I see is
-: 1:#include <coroutine>
-: 2:#include <iostream>
-: 3:
-: 4:struct task {
-: 5: struct promise {
-: 6: using handle_t = std::coroutine_handle<promise>;
1: 7: task get_return_object() {
1: 8: return task{handle_t::from_promise(*this)};
-: 9: }
1: 10: std::suspend_never initial_suspend() noexcept { return {};
}
1: 11: std::suspend_always final_suspend() noexcept { return {}; }
#####: 12: void unhandled_exception() { std::terminate(); }
1: 13: void return_void() noexcept {}
-: 14: friend task;
-: 15: };
-: 16: using promise_type = promise;
1: 17: task(promise_type::handle_t handle) : handle_{handle} {}
1: 18: ~task() {
1: 19: if (handle_) {
1: 20: handle_.destroy();
-: 21: }
1: 22: }
-: 23: private:
-: 24: promise_type::handle_t handle_;
-: 25:};
-: 26:
1: 27:task foo() {
-: 28: std::cout << "Running..." << std::endl;
-: 29: co_return;
2: 30:}
-: 31:
1: 32:int main(int argc, char **argv) {
1: 33: foo();
1: 34: return 0;
-: 35:}
I have no idea why for example line 28 isn't marked executed.