xref: /freebsd/contrib/unifdef/tests/if4.c (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
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)
9 int foo1() { return 0; }
10 #else
11 #error FOO or FOOB not defined
12 #endif
13 
14 #if defined(FOOB) || defined(FOO)
15 int foo2() { return 0; }
16 #else
17 #error FOO or FOOB not defined
18 #endif
19 
20 #if defined(FOO) && defined(FOOB)
21 int foo3() { return 0; }
22 #else
23 #error FOO and FOOB not defined
24 #endif
25 
26 #if defined(FOOB) && defined(FOO)
27 int foo4() { return 0; }
28 #else
29 #error FOO and FOOB not defined
30 #endif
31 
32 int main()
33 {
34   foo1();
35   foo2();
36   foo3();
37   foo4();
38 }
39