aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-10-15 10:48:17 +0200
committerlemon <lsof@mailbox.org>2025-10-15 10:48:17 +0200
commit347d237a114495c0a9b9d14d38551d544dca021d (patch)
tree5bcb06dcf119a99b7208534dbb7ba583aafce582
parent437efda31319573dcf67337d1cc6e4a23a6967a4 (diff)
test more cpp behavior
-rw-r--r--test/pp.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/pp.c b/test/pp.c
index 51cf70f..85b4cba 100644
--- a/test/pp.c
+++ b/test/pp.c
@@ -3,6 +3,8 @@
#include "pp.h"
#include <stddef.h>
#include <stdio.h>
+#include <assert.h>
+#include <limits.h>
//
#define CATl(a) a##bar
#define CATr(a) foo##a
@@ -15,6 +17,12 @@
#define join(c, d) in_between(c hash_hash d)
char p[] = join(x, y); // equivalent to char p[] = "x ## y";
+#define PUTS p\
+u\
+t\
+s
+
+
int
main(void)
{
@@ -30,5 +38,15 @@ main(void)
printf("%s "
"%s %g\n", str(Foo,5), xstr(Foo), CAT(1.5,e3f) + CAT(7,)-CAT(,1));
printf("join: \"%s\"\n", p);
+
+ PUT\
+S\
+("Output ends here\\
+0Not printed" /* After line splicing, the remaining backslash
+ * escapes the 0, ending the string early.
+ */
+);
+
+
CAT(ret,urn) 0;
}