xref: /freebsd/contrib/unifdef/tests/if4.c (revision d37eb51047221dc3322b34db1038ff3aa533883f)
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