freebsd-src/contrib/unifdef/tests/if5.c
Dag-Erling Smørgrav fb3ef04d20 Add 'contrib/unifdef/' from commit '0da44885831dc0a43c4ca6ff04a2430993cc0a80'
git-subtree-dir: contrib/unifdef
git-subtree-mainline: 3b7ffacdee
git-subtree-split: 0da4488583
2023-08-21 19:51:03 +02:00

81 lines
1.2 KiB
C

/* Copyright 2004 Bob Proulx <bob@proulx.com>
Distributed under the two-clause BSD licence;
see the COPYING file for details. */
#include <stdio.h>
#include <stdlib.h>
#if FOOB == 42
int foo1() { return 0; }
#else
#error FOOB not 42
#endif
#if FOOB != 42
#error FOO is 2
#else
int foo2() { return 0; }
#endif
#if FOOB == 42 || FOO == 1
int foo3() { return 0; }
#else
#error FOO not 1 or BAR not 1
#endif
#if FOOB != 42 && FOO != 1
#error FOOB not 42 and FOO not 1
#else
int foo4() { return 0; }
#endif
#if FOOB == 42 || FOO != 1
int foo5() { return 0; }
#else
#error FOOB is 42 or FOO is not 1
#endif
#if FOO != 1 || FOOB != 42
#error FOO is 1 or FOOB is 42
#else
int foo6() { return 0; }
#endif
#if FOO > FOOB
#error FOO is greater than FOOB
#else
int foo7() { return 0; }
#endif
#if FOOB < FOO
#error FOOB is less than FOO
#else
int foo8() { return 0; }
#endif
#if FOO >= FOOB
#error FOO is greater than or equal FOOB
#else
int foo9() { return 0; }
#endif
#if FOOB <= FOO
#error FOOB is less than or equal FOO
#else
int foo10() { return 0; }
#endif
int main()
{
foo1();
foo2();
foo3();
foo4();
foo5();
foo6();
foo7();
foo8();
foo9();
foo10();
}