Mercurial > hg > CbC > old > device
view test/ifdef.c @ 927:b491db049d74
Added tag current-release for changeset 4e73a22327a8
author | kono |
---|---|
date | Sun, 13 Apr 2014 10:20:02 +0900 |
parents | 5313ed059cee |
children |
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; }