xref: /freebsd/contrib/unifdef/tests/if4.c (revision fb3ef04d2028110f06d68b09009f1f2ca0f4128e)
1 /* Copyright 2004 Bob Proulx <bob@proulx.com>
2 Distributed under the two-clause BSD licence;
3 see the COPYING file for details. */
4 
5 #include <stdio.h>
6 #include <stdlib.h>
7 
8 #if defined(FOO) || defined(FOOB)
foo1()9 int foo1() { return 0; }
10 #else
11 #error FOO or FOOB not defined
12 #endif
13 
14 #if defined(FOOB) || defined(FOO)
foo2()15 int foo2() { return 0; }
16 #else
17 #error FOO or FOOB not defined
18 #endif
19 
20 #if defined(FOO) && defined(FOOB)
foo3()21 int foo3() { return 0; }
22 #else
23 #error FOO and FOOB not defined
24 #endif
25 
26 #if defined(FOOB) && defined(FOO)
foo4()27 int foo4() { return 0; }
28 #else
29 #error FOO and FOOB not defined
30 #endif
31 
main()32 int main()
33 {
34   foo1();
35   foo2();
36   foo3();
37   foo4();
38 }
39