diff options
| author | jiang <30155751@qq.com> | 2014-05-17 00:55:02 +0800 |
|---|---|---|
| committer | jiang <30155751@qq.com> | 2014-05-17 00:55:02 +0800 |
| commit | 196c9995151e046fcbc78d8a72f66a7176fd1456 (patch) | |
| tree | 991d1eac14975d280e8d8803a767e690163896bd /tests | |
| parent | 276553c6b2b4df0ac9593d15b8889d470edb27de (diff) | |
| download | tinycc-196c9995151e046fcbc78d8a72f66a7176fd1456.tar.gz tinycc-196c9995151e046fcbc78d8a72f66a7176fd1456.tar.bz2 | |
1 macro_push and macro_pop work I made a mistake, no matter the definition does not define can be macro_push.
And the modified tcctest.c test
2, pack: in the compiler under the mode of s1->ppfp, I have no clear ideas1->ppfp
Some advice thank you Roy to me.This patch, I hope I can pass the Roy test
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/tcctest.c | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/tests/tcctest.c b/tests/tcctest.c index e0b307b..54465a6 100644 --- a/tests/tcctest.c +++ b/tests/tcctest.c @@ -379,34 +379,46 @@ 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") - printf(MACRO_TEST); #undef MACRO_TEST + #ifdef MACRO_TEST + printf("define MACRO_TEST\n"); + #else + printf("undef MACRO_TEST\n"); + #endif - #define MACRO_TEST "macro_test2\n" #pragma push_macro("MACRO_TEST") - printf(MACRO_TEST); - #undef MACRO_TEST - - #define MACRO_TEST "macro_test3\n" + #define MACRO_TEST #pragma push_macro("MACRO_TEST") - printf(MACRO_TEST); - #undef MACRO_TEST - - #define MACRO_TEST "macro_test4\n" - printf(MACRO_TEST); #undef MACRO_TEST + #pragma push_macro("MACRO_TEST") #pragma pop_macro("MACRO_TEST") - printf(MACRO_TEST); + #ifdef MACRO_TEST + printf("define MACRO_TEST\n"); + #else + printf("undef MACRO_TEST\n"); + #endif #pragma pop_macro("MACRO_TEST") - printf(MACRO_TEST); + #ifdef MACRO_TEST + printf("define MACRO_TEST\n"); + #else + printf("undef MACRO_TEST\n"); + #endif #pragma pop_macro("MACRO_TEST") - printf(MACRO_TEST); + #ifdef MACRO_TEST + printf("define MACRO_TEST\n"); + #else + printf("undef MACRO_TEST\n"); + #endif + + /* pack test */ + #pragma pack(push,8) + #pragma pack(pop) + /* gcc does not support #define MACRO_TEST_MACRO "MACRO_TEST" #pragma push_macro(MACRO_TEST_MACRO) |
