1 // RUN: %clang_cc1 -std=c++14 -fcoroutines-ts -triple=x86_64-pc-windows-msvc18.0.0 -emit-llvm -o - %s -fexceptions -fcxx-exceptions -disable-llvm-passes | FileCheck %s
2 // -triple=x86_64-unknown-linux-gnu
4 #include "Inputs/coroutine.h"
6 namespace coro = std::experimental::coroutines_v1;
12 coro_t get_return_object();
13 coro::suspend_never initial_suspend();
14 coro::suspend_never final_suspend();
18 void unhandled_exception();
22 struct Cleanup { ~Cleanup(); };
31 // CHECK-LABEL: define dso_local void @"?f@@YA?AUcoro_t@@XZ"(
32 // CHECK: %gro.active = alloca i1
33 // CHECK: store i1 false, i1* %gro.active
35 // CHECK: invoke %"struct.coro_t::promise_type"* @"??0promise_type@coro_t@@QEAA@XZ"(
36 // CHECK: invoke void @"?get_return_object@promise_type@coro_t@@QEAA?AU2@XZ"(
37 // CHECK: store i1 true, i1* %gro.active
39 // CHECK: %[[IS_ACTIVE:.+]] = load i1, i1* %gro.active
40 // CHECK: br i1 %[[IS_ACTIVE]], label %[[CLEANUP1:.+]], label
42 // CHECK: [[CLEANUP1]]:
43 // CHECK: %[[NRVO:.+]] = load i1, i1* %nrvo
44 // CHECK: br i1 %[[NRVO]], label %{{.+}}, label %[[DTOR:.+]]
47 // CHECK: call void @"??1coro_t@@QEAA@XZ"(