diff options
| author | 2025-10-15 10:48:17 +0200 | |
|---|---|---|
| committer | 2025-10-15 10:48:17 +0200 | |
| commit | 347d237a114495c0a9b9d14d38551d544dca021d (patch) | |
| tree | 5bcb06dcf119a99b7208534dbb7ba583aafce582 /test/pp.c | |
| parent | 437efda31319573dcf67337d1cc6e4a23a6967a4 (diff) | |
test more cpp behavior
Diffstat (limited to 'test/pp.c')
| -rw-r--r-- | test/pp.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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; } |