| 1 | // RUN: %clang_cc1 -triple x86_64-pc-windows-msvc18.0.0 -fcoroutines-ts -emit-llvm %s -o - -std=c++14 -disable-llvm-passes | FileCheck %s |
| 2 | struct no_suspend { |
| 3 | bool await_ready() { return true; } |
| 4 | template <typename F> void await_suspend(F) {} |
| 5 | void await_resume() {} |
| 6 | }; |
| 7 | |
| 8 | struct A { |
| 9 | no_suspend operator co_await() { return {}; } |
| 10 | }; |
| 11 | |
| 12 | struct B {}; |
| 13 | |
| 14 | no_suspend operator co_await(B const&) { return {}; } |
| 15 | |
| 16 | // CHECK-LABEL: f( |
| 17 | extern "C" void f() { |
| 18 | A a; |
| 19 | B b; |
| 20 | // CHECK: call void @"??__LA@@QEAA?AUno_suspend@@XZ"( |
| 21 | a.operator co_await(); |
| 22 | // CHECK-NEXT: call i8 @"??__L@YA?AUno_suspend@@AEBUB@@@Z"( |
| 23 | operator co_await(b); |
| 24 | } |
| 25 | |
| 26 | |