brintos

brintos / llvm-project-archived public Read only

0
0
Text · 468 B · 2d0ca93 Raw
18 lines · cpp
1// RUN: %clang_cc1 -verify -fsyntax-only %s2 3int __attribute__((not_tail_called)) foo1(int a) {// expected-note {{'not_tail_called' attribute prevents being called as a tail call}}4    return a + 1;  5}6 7 8int foo2(int a) {9    [[clang::musttail]] 10    return foo1(a);  // expected-error {{cannot perform a tail call to function 'foo1' because its signature is incompatible with the calling function}} 11}12 13int main() {14    int result = foo2(10);      15    return 0;16}17 18