view test/ifdef.c @ 496:5640fb7a270d

more bugs...
author kono
date Thu, 22 Dec 2005 00:20:09 +0900
parents 0c256ea2a97e
children 5313ed059cee
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

/* odd comment test */

#if 0
#endif /*  whoeh
     wohefwiehfoi */

main()
{
	/* freopen("mcout.s","w",stdout); */
        printf("#0067:test\n");
        printf("#0068:%s\n",test0);
        printf("#0069:%s\n",test1);
        printf("#0070:%s\n",test2);
        printf("#0071:%s\n",test3);
        printf("#0072:%s\n",test4);
        printf("#0073:%s\n",test5);
	return 0;
}