2016-10-02 11:31:58 +08:00
|
|
|
// 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
|
2016-09-29 06:37:17 +08:00
|
|
|
struct no_suspend {
|
|
|
|
bool await_ready() { return true; }
|
|
|
|
template <typename F> void await_suspend(F) {}
|
|
|
|
void await_resume() {}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct A {
|
|
|
|
no_suspend operator co_await() { return {}; }
|
|
|
|
};
|
|
|
|
|
|
|
|
struct B {};
|
|
|
|
|
|
|
|
no_suspend operator co_await(B const&) { return {}; }
|
|
|
|
|
|
|
|
// CHECK-LABEL: f(
|
|
|
|
extern "C" void f() {
|
|
|
|
A a;
|
|
|
|
B b;
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK: call void @"??__LA@@QEAA?AUno_suspend@@XZ"(
|
2016-09-29 06:37:17 +08:00
|
|
|
a.operator co_await();
|
2018-03-17 04:36:49 +08:00
|
|
|
// CHECK-NEXT: call i8 @"??__L@YA?AUno_suspend@@AEBUB@@@Z"(
|
2016-09-29 06:37:17 +08:00
|
|
|
operator co_await(b);
|
|
|
|
}
|
|
|
|
|