comparison clang/test/Sema/attr-musttail.c @ 221:79ff65ed7e25

LLVM12 Original
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 15 Jun 2021 19:15:29 +0900
parents
children
comparison
equal deleted inserted replaced
220:42394fc6a535 221:79ff65ed7e25
1 // RUN: %clang_cc1 -verify -fsyntax-only %s
2
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}}
6 }
7
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}}
11 }
12
13 int TestProtoType(void) {
14 return ProtoType();
15 }