1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c89 -Wfunction-effects -internal-isystem %S/../Headers/Inputs/include %s
3 // Tests for a few cases involving C functions without prototypes.
5 void hasproto(void) __attribute__((blocking
)); // expected-note {{function does not permit inference of 'nonblocking' because it is declared 'blocking'}}
7 // Has no prototype, inferably safe.
10 // Has no prototype, noreturn.
14 void nb2(void) __attribute__((nonblocking
)) {
15 hasproto(); // expected-warning {{function with 'nonblocking' attribute must not call non-'nonblocking' function 'hasproto'}}
17 aborts(); // no diagnostic because it's noreturn.
22 void nb3(int x
, int y
) __attribute__((nonblocking
)) {
25 longjmp(jb
, 0); // expected-warning {{function with 'nonblocking' attribute must not call non-'nonblocking' function 'longjmp'}}