-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The compiler is crashing when compiling a coroutine intrinsic without
the use of the option fcoroutines-ts. This is a patch to fix this. Fix for https://bugs.llvm.org/show_bug.cgi?id=50406
- Loading branch information
Showing
4 changed files
with
43 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -verify -fcoroutines-ts %s | ||
// RUN: %clang_cc1 -fsyntax-only -verify -DERRORS %s | ||
|
||
// Check that we don't crash when using __builtin_coro_* without the fcoroutine-ts option | ||
|
||
#ifdef ERRORS | ||
// expected-error@#A{{use of undeclared identifier '__builtin_coro_done'}} | ||
// expected-error@#B{{use of undeclared identifier '__builtin_coro_id'}} | ||
// expected-error@#C{{use of undeclared identifier '__builtin_coro_alloc'}} | ||
#else | ||
// expected-no-diagnostics | ||
#endif | ||
|
||
int main() { | ||
void *co_h; | ||
bool d = __builtin_coro_done(co_h); // #A | ||
__builtin_coro_id(32, 0, 0, 0); // #B | ||
__builtin_coro_alloc(); // #C | ||
} |