diff options
| author | jiang <30155751@qq.com> | 2014-05-13 22:05:38 +0800 |
|---|---|---|
| committer | jiang <30155751@qq.com> | 2014-05-13 22:05:38 +0800 |
| commit | c6345b5a8af36d5577307860644010b1528257d3 (patch) | |
| tree | ba8dde98b273254a30c852e64ef63a4fa274d3ab /tests | |
| parent | 72f466c24c5347516ca5a81221e29129dafe1c63 (diff) | |
| download | tinycc-c6345b5a8af36d5577307860644010b1528257d3.tar.gz tinycc-c6345b5a8af36d5577307860644010b1528257d3.tar.bz2 | |
restore 2dd8587c2f32d17a2cd0443a60a614a3fa9bbe29
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/tcctest.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/tests/tcctest.c b/tests/tcctest.c index cc8ffd8..ee4a0e6 100644 --- a/tests/tcctest.c +++ b/tests/tcctest.c @@ -235,7 +235,7 @@ void intdiv_test(void) void macro_test(void) { - printf("macro:\n");
+ printf("macro:\n"); pf("N=%d\n", N); printf("aaa=%d\n", AAA); @@ -379,6 +379,23 @@ comment /* And again when the name and parenthes are separated by a comment. */ TEST2 /* the comment */ (); + /* macro_push and macro_pop test */ + #define MACRO_TEST "macro_test1\n" + #pragma push_macro("MACRO_TEST") + #undef MACRO_TEST + #define MACRO_TEST "macro_test2\n" + printf(MACRO_TEST); + #pragma pop_macro("MACRO_TEST") + printf(MACRO_TEST); +/* gcc does not support + #define MACRO_TEST_MACRO "MACRO_TEST" + #pragma push_macro(MACRO_TEST_MACRO) + #undef MACRO_TEST + #define MACRO_TEST "macro_test3\n" + printf(MACRO_TEST); + #pragma pop_macro(MACRO_TEST_MACRO) + printf(MACRO_TEST); +*/ } @@ -2155,14 +2172,15 @@ void whitespace_test(void) { char *str; -
#if 1 + +#if 1 pri\ -ntf("whitspace:\n");
+ntf("whitspace:\n"); #endif pf("N=%d\n", 2); #ifdef CORRECT_CR_HANDLING - pri\
+ pri\ ntf("aaa=%d\n", 3); #endif @@ -2174,11 +2192,12 @@ ntf("min=%d\n", 4); printf("len1=%d\n", strlen(" ")); #ifdef CORRECT_CR_HANDLING - str = "
+ str = " "; printf("len1=%d str[0]=%d\n", strlen(str), str[0]); #endif - printf("len1=%d\n", strlen("
a + printf("len1=%d\n", strlen(" +a ")); #endif /* ACCEPT_CR_IN_STRINGS */ } |
