[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / coroutine-builtins.cpp
blob7fa1b49172c2f29dc258aaf68c0fc69a250a4af8
1 // RUN: %clang_cc1 -fsyntax-only -verify -fcoroutines-ts %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -DERRORS %s
5 // Check that we don't crash when using __builtin_coro_* without the fcoroutine-ts or -std=c++20 option
7 #ifdef ERRORS
8 // expected-error@#A{{use of undeclared identifier '__builtin_coro_done'}}
9 // expected-error@#B{{use of undeclared identifier '__builtin_coro_id'}}
10 // expected-error@#C{{use of undeclared identifier '__builtin_coro_alloc'}}
11 #else
12 // expected-no-diagnostics
13 #endif
15 int main() {
16 void *co_h;
17 bool d = __builtin_coro_done(co_h); // #A
18 __builtin_coro_id(32, 0, 0, 0); // #B
19 __builtin_coro_alloc(); // #C