From 65ecaf18aa34d3e76abbfd757797fa4dda9bb195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 12 Jul 2022 03:16:34 +0200 Subject: Resolve # ## # --- tests/test/cpp/preprocessor2.scm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'tests/test') diff --git a/tests/test/cpp/preprocessor2.scm b/tests/test/cpp/preprocessor2.scm index 2d95269a..182390c6 100644 --- a/tests/test/cpp/preprocessor2.scm +++ b/tests/test/cpp/preprocessor2.scm @@ -35,7 +35,7 @@ :use-module (c lex2) ) -(test-expect-fail "x ## y") +;; (test-expect-fail "x ## y") (define apply-macro (@@ (c preprocessor2) apply-macro)) (define build-parameter-map (@@ (c preprocessor2) build-parameter-map)) @@ -694,14 +694,14 @@ f(a)")) ;; 6.10.3.3 p. 4 (test-equal "x ## y" - (lex "\"x ## y\"") + (lex "char p[] = \"x ## y\"") (run " #define hash_hash # ## # #define mkstr(a) # a #define in_between(a) mkstr(a) #define join(c, d) in_between(c hash_hash d) -join(x, y)"))) +char p[] = join(x, y)"))) (test-group "__VA_ARGS__" (test-equal "__VA_ARGS__ split its arguments" @@ -834,6 +834,21 @@ f(g)(5)")) ;; #< type: preprocessing-token body: (pp-number "5") noexpand: ()> ;; #< type: preprocessing-token body: (punctuator ")") noexpand: ()>) +(test-equal "non-adjacent parameter list" + (lex "2*10") + (run " +#define f(x) 2*x +f (10)")) + +(test-equal "parameter-list on own line" + (lex "2*10") + (run " +#define f(x) 2*x +f + + +(10)")) + (define unlex (@ (c unlex) unlex)) (test-group "6.10.3.5 Scope of macro definitions" -- cgit v1.2.3