xref: /freebsd/contrib/unifdef/tests/if5-k.expout (revision a90b9d0159070121c221b966469c3e36d912bf82)
1/* Copyright 2004, 2008 Bob Proulx <bob@proulx.com>
2Distributed under the two-clause BSD licence;
3see the COPYING file for details. */
4
5#include <stdio.h>
6#include <stdlib.h>
7
8/* This code is passed through. "#if 0 else" */
9
10/* This code is passed through. "#if 1 then" */
11
12#if FOOB == 42
13int foo1() { return 0; }
14#else
15#error FOOB not 42
16#endif
17
18#if FOOB != 42
19#error FOO is 2
20#else
21int foo2() { return 0; }
22#endif
23
24#if FOOB == 42 || FOO == 1
25intx foo3() { return 0; }
26#else
27#error FOO not 1 or BAR not 1
28#endif
29
30#if FOOB != 42 && FOO != 1
31#error FOOB not 42 and FOO not 1
32#else
33int foo4() { return 0; }
34#endif
35
36#if FOOB == 42 || FOO != 1
37int foo5() { return 0; }
38#else
39#error FOOB is 42 or FOO is not 1
40#endif
41
42#if FOO != 1 || FOOB != 42
43#error FOO is 1 or FOOB is 42
44#else
45int foo6() { return 0; }
46#endif
47
48int main()
49{
50  foo1();
51  foo2();
52  foo3();
53  foo4();
54  foo5();
55  foo6();
56}
57