aboutsummaryrefslogtreecommitdiff
path: root/tests/test/cpp/preprocessor2.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test/cpp/preprocessor2.scm')
-rw-r--r--tests/test/cpp/preprocessor2.scm21
1 files changed, 18 insertions, 3 deletions
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)"))
;; #<<lexeme> type: preprocessing-token body: (pp-number "5") noexpand: ()>
;; #<<lexeme> 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"