summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-05-28 15:06:02 -0700
committerCarl Worth <cworth@cworth.org>2010-05-28 15:10:27 -0700
commit681afbc855c86df8c3521ccdfadb7f16b9729baa (patch)
treee45f5bf4bc3eb0768fcdc47fea7c97a2b0eab329 /tests
parent3c93d397050bbeccb7809e53a425c860df947c45 (diff)
Perform macro by replacing tokens in original list.
We take the results of macro expansion and splice them into the original token list over which we are iterating. This makes it easy for function-like macro invocations to find their arguments since they are simply subsequent tokens on the list. This fixes the recently-introduced regressions (tests 55 and 56) and also passes new tests 60 and 61 introduced to strees this feature, (with macro-argument parentheses split between a macro value and the textual input).
Diffstat (limited to 'tests')
-rw-r--r--tests/060-left-paren-in-macro-right-paren-in-text.c3
-rw-r--r--tests/061-define-chain-obj-to-func-multi.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/060-left-paren-in-macro-right-paren-in-text.c b/tests/060-left-paren-in-macro-right-paren-in-text.c
new file mode 100644
index 0000000000..ed80ea879c
--- /dev/null
+++ b/tests/060-left-paren-in-macro-right-paren-in-text.c
@@ -0,0 +1,3 @@
+#define double(a) a*2
+#define foo double(
+foo 5)
diff --git a/tests/061-define-chain-obj-to-func-multi.c b/tests/061-define-chain-obj-to-func-multi.c
new file mode 100644
index 0000000000..6dbfd1f62d
--- /dev/null
+++ b/tests/061-define-chain-obj-to-func-multi.c
@@ -0,0 +1,5 @@
+#define foo(x) success
+#define bar foo
+#define baz bar
+#define joe baz
+joe (failure)