| 1 |
// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -target-feature +tail-call -o /dev/null -emit-llvm -verify=tail |
| 2 |
// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -o /dev/null -emit-llvm -verify=notail |
| 3 |
|
| 4 |
int foo(int x) { |
| 5 |
return x; |
| 6 |
} |
| 7 |
|
| 8 |
#if __has_attribute(musttail) |
| 9 |
// tail-warning@+1 {{HAS IT}} |
| 10 |
#warning HAS IT |
| 11 |
#else |
| 12 |
// notail-warning@+1 {{DOES NOT HAVE}} |
| 13 |
#warning DOES NOT HAVE |
| 14 |
#endif |
| 15 |
|
| 16 |
int bar(int x) |
| 17 |
{ |
| 18 |
// notail-warning@+1 {{unknown attribute 'clang::musttail' ignored}} |
| 19 |
[[clang::musttail]] return foo(1); |
| 20 |
} |