1 // RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -triple=x86_64-unknown-linux-gnu -emit-llvm %s -o - -disable-llvm-passes | FileCheck %s 2 3 #include "Inputs/coroutine.h" 4 5 namespace coro = std::experimental::coroutines_v1; 6 7 struct coro1 { 8 struct promise_type { 9 coro1 get_return_object(); 10 coro::suspend_never initial_suspend(); 11 coro::suspend_never final_suspend(); 12 void return_void(); 13 }; 14 }; 15 16 coro1 f() { 17 co_await coro::suspend_never{}; 18 } 19 20 // CHECK-LABEL: define void @_Z1fv( 21 // CHECK: call void @_ZNSt12experimental13coroutines_v113suspend_never12await_resumeEv(%"struct.std::experimental::coroutines_v1::suspend_never"* 22 // CHECK: call void @_ZN5coro112promise_type11return_voidEv(%"struct.coro1::promise_type"* %__promise) 23 24 struct coro2 { 25 struct promise_type { 26 coro2 get_return_object(); 27 coro::suspend_never initial_suspend(); 28 coro::suspend_never final_suspend(); 29 void return_value(int); 30 }; 31 }; 32 33 coro2 g() { 34 co_return 42; 35 } 36 37 // CHECK-LABEL: define void @_Z1gv( 38 // CHECK: call void @_ZNSt12experimental13coroutines_v113suspend_never12await_resumeEv(%"struct.std::experimental::coroutines_v1::suspend_never"* 39 // CHECK: call void @_ZN5coro212promise_type12return_valueEi(%"struct.coro2::promise_type"* %__promise, i32 42) 40