view test/ifdef.c @ 412:6b3385124e5e arm-self-compile

ARM regsiter var pattern fix.
author kono
date Tue, 19 Oct 2004 23:39:42 +0900
parents e1a96bdbe527
children 0c256ea2a97e
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("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);
	return 0;
}