Alex Lorenz | 977ffd7 | 2019-01-03 01:13:33 +0000 | [diff] [blame] | 1 | // RUN: c-index-test -test-load-source all -c %s -fsyntax-only -target x86_64-apple-darwin9 -fcoroutines-ts -std=c++1z -I%S/../SemaCXX/Inputs | FileCheck %s |
| 2 | #include "std-coroutine.h" |
| 3 | |
| 4 | using std::experimental::suspend_always; |
| 5 | using std::experimental::suspend_never; |
| 6 | |
| 7 | struct promise_void { |
| 8 | void get_return_object(); |
| 9 | suspend_always initial_suspend(); |
Xun Li | 516803d | 2020-06-15 16:27:41 -0700 | [diff] [blame] | 10 | suspend_always final_suspend() noexcept; |
Alex Lorenz | 977ffd7 | 2019-01-03 01:13:33 +0000 | [diff] [blame] | 11 | void return_void(); |
| 12 | void unhandled_exception(); |
| 13 | }; |
| 14 | |
| 15 | template <> |
| 16 | struct std::experimental::coroutine_traits<void> { using promise_type = promise_void; }; |
| 17 | |
| 18 | void CoroutineTestRet() { |
| 19 | co_return; |
| 20 | } |
| 21 | // CHECK: [[@LINE-3]]:25: UnexposedStmt= |
| 22 | // CHECK-SAME: [[@LINE-4]]:25 - [[@LINE-2]]:2] |
Alex Lorenz | ddc6201 | 2019-01-03 01:30:50 +0000 | [diff] [blame] | 23 | // CHECK: [[@LINE-4]]:3: UnexposedStmt= |
| 24 | // CHECK-SAME: [[@LINE-5]]:3 - [[@LINE-5]]:12] |