Fixes include the double quotes bug

Added push_macro, pop_macro support
Fix pack bug, when output with-E will pack the bug
This commit is contained in:
jiang
2014-05-02 11:23:54 +08:00
parent 5b52a44b52
commit 6c8207633f
6 changed files with 248 additions and 111 deletions

View File

@ -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);
*/
}
@ -2167,14 +2184,15 @@ void whitespace_test(void)
{
char *str;
#if 1
pri\
pri\
ntf("whitspace:\n");
#endif
pf("N=%d\n", 2);
#ifdef CORRECT_CR_HANDLING
#ifdef CORRECT_CR_HANDLING
pri\
ntf("aaa=%d\n", 3);
#endif
@ -2186,11 +2204,12 @@ ntf("min=%d\n", 4);
printf("len1=%d\n", strlen("
"));
#ifdef CORRECT_CR_HANDLING
#ifdef CORRECT_CR_HANDLING
str = "
";
printf("len1=%d str[0]=%d\n", strlen(str), str[0]);
#endif
#endif
printf("len1=%d\n", strlen("
a
"));
#endif /* ACCEPT_CR_IN_STRINGS */
}