• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 {
await_readyno_suspend3   bool await_ready() { return true; }
await_suspendno_suspend4   template <typename F> void await_suspend(F) {}
await_resumeno_suspend5   void await_resume() {}
6 };
7 
8 struct A {
operator co_awaitA9   no_suspend operator co_await() { return {}; }
10 };
11 
12 struct B {};
13 
operator co_await(B const &)14 no_suspend operator co_await(B const&) { return {}; }
15 
16 // CHECK-LABEL: f(
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