[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Sema / attr-musttail.c
blobb17947c68ba96a6945a992ad7e6f893280c4a1cc
1 // RUN: %clang_cc1 -verify -fsyntax-only %s
3 int NotAProtoType(); // expected-note{{add 'void' to the parameter list to turn an old-style K&R function declaration into a prototype}}
4 int TestCalleeNotProtoType(void) {
5 __attribute__((musttail)) return NotAProtoType(); // expected-error{{'musttail' attribute requires that both caller and callee functions have a prototype}}
8 int ProtoType(void);
9 int TestCallerNotProtoType() { // expected-note{{add 'void' to the parameter list to turn an old-style K&R function declaration into a prototype}}
10 __attribute__((musttail)) return ProtoType(); // expected-error{{'musttail' attribute requires that both caller and callee functions have a prototype}}
13 int TestProtoType(void) {
14 return ProtoType();