view clang/test/Sema/attr-musttail.c @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 79ff65ed7e25
children
line wrap: on
line source

// RUN: %clang_cc1 -verify -fsyntax-only %s

int NotAProtoType(); // expected-note{{add 'void' to the parameter list to turn an old-style K&R function declaration into a prototype}}
int TestCalleeNotProtoType(void) {
  __attribute__((musttail)) return NotAProtoType(); // expected-error{{'musttail' attribute requires that both caller and callee functions have a prototype}}
}

int ProtoType(void);
int TestCallerNotProtoType() {                  // expected-note{{add 'void' to the parameter list to turn an old-style K&R function declaration into a prototype}}
  __attribute__((musttail)) return ProtoType(); // expected-error{{'musttail' attribute requires that both caller and callee functions have a prototype}}
}

int TestProtoType(void) {
  return ProtoType();
}