scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 3ead769a620c76bba4456774c718a8bf9f39fe7f
parent a3bd2a62cb057fa6a7b35feba3212287ba4ccc58
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 22 Mar 2022 09:58:15 +0100

tests/cc: Add test 0201-cpp.c

Diffstat:
Atests/cc/execute/0201-cpp.c | 26++++++++++++++++++++++++++
Mtests/cc/execute/scc-tests.lst | 1+
2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/tests/cc/execute/0201-cpp.c b/tests/cc/execute/0201-cpp.c @@ -0,0 +1,26 @@ +/* taken from ISO/IEC 9899:1999 Section 6.10.3.5 p7 */ + +#define t(x,y,z) x ## y ## z + +int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), + t(10,,), t(,11,), t(,,12), t(,,) }; + +int +main() +{ + if (j[0] != 123) + return 1; + if (j[1] != 45) + return 2; + if (j[2] != 67) + return 3; + if (j[3] != 89) + return 4; + if (j[4] != 10) + return 5; + if (j[5] != 11) + return 6; + if (j[6] != 12) + return 7; + return 0; +} diff --git a/tests/cc/execute/scc-tests.lst b/tests/cc/execute/scc-tests.lst @@ -191,3 +191,4 @@ 0198-nullcpp.c 0199-voidpcast.c [TODO] 0200-cpp.c [TODO] +0201-cpp.c [TODO]