view test/ifdef.c @ 36:9f89cef85b41

*** empty log message ***
author kono
date Mon, 10 Feb 2003 10:07:00 +0900
parents
children 096559f07a70
line wrap: on
line source

#include "stdio.h"

/*
#ifdef TEST
#define TEST
#else
#define TEST
#endif
 */
#ifdef TEST
static char test0[]="test 0 bad\n";
#ifdef TEST
   bad * bad * bad
#else
   bad * bad * bad
#endif
#else
static char test0[]="test 0 ok\n";
/* test nested if and checked undefined macro check */
#ifdef TEST
   bad * bad * bad
#else
   /* OK */
#endif
#endif

#if defined(TEST)
static char test1[]="test 1 bad\n";
#else
static char test1[]="test 1 ok\n";
#endif

#define TEST 1

#ifdef TEST
static char test2[]="test 2 ok\n";
#else
static char test2[]="test 2 bad\n";
#endif

#if defined(TEST)
static char test3[]="test 3 ok\n";
#else
static char test3[]="test 3 bad\n";
#endif

#if TEST
static char test4[]="test 4 ok\n";
#else
static char test4[]="test 4 bad\n";
#endif

#if !TEST
static char test5[]="test 5 bad\n";
#else
static char test5[]="test 5 ok\n";
#endif

main()
{
	/* freopen("mcout.s","w",stdout); */
        printf("test\n");
        printf("%s\n",test0);
        printf("%s\n",test1);
        printf("%s\n",test2);
        printf("%s\n",test3);
        printf("%s\n",test4);
        printf("%s\n",test5);
}