History

test macro substitution inside macro args

bellard committed 23 years ago

Commit 59087251 parent edbfa771 file · +10 −1Browse files

Unified · Split

tcctest.c+10−1
@@ -123,6 +123,12 @@ int isid(int c); · 122 unmodified lines
123123 #define __INT64_C(c) c ## LL
124124 #define INT64_MIN (-__INT64_C(9223372036854775807)-1)
125125
126+int qq(int x)
127+{
128+ return x + 40;
129+}
130+#define qq(x) x
131+
126132 void macro_test(void)
127133 {
128134 printf("macro:\n");
@@ -210,7 +216,7 @@ void macro_test(void) · 81 unmodified lines
210216 #line 203 "test"
211217 printf("__LINE__=%d __FILE__=%s\n",
212218 __LINE__, __FILE__);
213−#line 213 "tcctest.c"
219+#line 220 "tcctest.c"
214220
215221 /* not strictly preprocessor, but we test it there */
216222 #ifdef C99_MACROS
@@ -244,6 +250,9 @@ void macro_test(void) · 27 unmodified lines
244250 MF_s("hi");
245251 MF_t("hi");
246252
253+ /* test macro substituion inside args (should not eat stream) */
254+ printf("qq=%d\n", qq(qq)(2));
255+
247256 /* comment with stray handling *\
248257 /
249258 /* this is a valid *\/ comment */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t