[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / AST / coroutine-source-location-crash-exp-namespace.cpp
blobfb9aaa537c40d3f1ea8b32c0ddc006aef6626d21
1 // Test without serialization:
2 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts \
3 // RUN: -fsyntax-only -ast-dump | FileCheck %s
4 //
5 // Test with serialization:
6 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -std=c++14 -fcoroutines-ts -emit-pch -o %t %s
7 // RUN: %clang_cc1 -x c++ -triple x86_64-apple-darwin9 -std=c++14 -fcoroutines-ts -include-pch %t \
8 // RUN: -ast-dump-all /dev/null \
9 // RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
10 // RUN: | FileCheck %s
12 #include "Inputs/std-coroutine-exp-namespace.h"
14 using namespace std::experimental;
16 struct A {
17 bool await_ready();
18 void await_resume();
19 template <typename F>
20 void await_suspend(F);
23 struct coro_t {
24 struct promise_type {
25 coro_t get_return_object();
26 suspend_never initial_suspend();
27 suspend_never final_suspend() noexcept;
28 void return_void();
29 static void unhandled_exception();
33 // {{0x[0-9a-fA-F]+}} <line:[[@LINE+1]]:1, col:36>
34 // CHECK-LABEL: FunctionDecl {{.*}} f 'coro_t (int)'
35 coro_t f(int n) {
36 A a{};
37 // CHECK: CoawaitExpr {{0x[0-9a-fA-F]+}} <col:3, col:12>
38 // CHECK-NEXT: DeclRefExpr {{0x[0-9a-fA-F]+}} <col:12>
39 // CHECK-NEXT: DeclRefExpr {{0x[0-9a-fA-F]+}} <col:12>
40 // CHECK-NEXT: CXXMemberCallExpr {{0x[0-9a-fA-F]+}} <col:12>
41 // CHECK-NEXT: MemberExpr {{0x[0-9a-fA-F]+}} <col:12>
42 co_await a;