scc

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

commit 580261b337c2cf10dbb361364d8bb066bdd05965
parent 81afcf38de71354670102ab5fc305b929c606559
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 15 Nov 2021 05:30:23 +0100

cc/tests: Add more regression tests

Diffstat:
Atests/cc/execute/0188-multi-string.c | 17+++++++++++++++++
Atests/cc/execute/0189-cpp-no.c | 13+++++++++++++
Atests/cc/execute/0190-enum-ary.c | 11+++++++++++
Mtests/cc/execute/scc-tests.lst | 3+++
4 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/tests/cc/execute/0188-multi-string.c b/tests/cc/execute/0188-multi-string.c @@ -0,0 +1,17 @@ +#define STR(x) #x +#define RES "This is a string!" + +int +main() +{ + char str1[] = STR(This is a string!); + char str2[] = RES; + int i; + + for (i = 0; str1[i]; i++) { + if (str1[i] != str2[i]) + break; + } + + return str1[i] - str2[i]; +} diff --git a/tests/cc/execute/0189-cpp-no.c b/tests/cc/execute/0189-cpp-no.c @@ -0,0 +1,13 @@ +# 1 "/home/k0ga/src/scc/tests/cc/execute/0126-macropar.c" +# 1 "<built-in>" +# 1 "<command-line>" +# 31 "<command-line>" +# 1 "/usr/include/stdc-predef.h" 1 3 4 +# 32 "<command-line>" 2 +# 1 "/home/k0ga/src/scc/tests/cc/execute/0126-macropar.c" + +int +main() +{ + return 0; +} diff --git a/tests/cc/execute/0190-enum-ary.c b/tests/cc/execute/0190-enum-ary.c @@ -0,0 +1,11 @@ +enum { Bla = 0, Bla2 = 1 }; + +struct node { + char name[Bla2]; +}; + +int +main(void) +{ + return 0; +} diff --git a/tests/cc/execute/scc-tests.lst b/tests/cc/execute/scc-tests.lst @@ -178,3 +178,6 @@ 0185-esc-macro2.c 0186-dec-ary.c 0187-zero-struct.c +0188-multi-string.c [TODO] +0189-cpp-no.c [TODO] +0190-enum-ary.c [TODO]