Debian Codegraph @

gcc/testsuite/gcc.dg/cwsc0.c

raw
1 /* { dg-do compile } */
2
3 #include <stddef.h>
4
5 void foo(void);
6 void test(int (*f)(void), char *p)
7 {
8 __builtin_call_with_static_chain(f(), p);
9 __builtin_call_with_static_chain(p, f()); /* { dg-error "must be a call" } */
10 __builtin_call_with_static_chain(f() + 1, p); /* { dg-error "must be a call" } */
11 __builtin_call_with_static_chain(f(), 0); /* { dg-error "must be a pointer" } */
12 __builtin_call_with_static_chain(f(), NULL);
13 __builtin_call_with_static_chain(foo, p); /* { dg-error "must be a call" } */
14 __builtin_call_with_static_chain(foo(), p);
15 __builtin_call_with_static_chain(foo(), foo);
16 }