scc

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

commit bc57c1cc1a92a39d4801d582753ebb6a34807b3c
parent eb450de6fc3e75a0a12059776e2d45db20be4075
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue,  7 Jan 2025 21:52:03 +0100

tests/cc: Add 0102-decl.c

This test checks for the c99 useless static array size hint.

Diffstat:
Atests/cc/execute/0102-decl.c | 15+++++++++++++++
Mtests/cc/execute/scc-tests.lst | 1+
2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/tests/cc/execute/0102-decl.c b/tests/cc/execute/0102-decl.c @@ -0,0 +1,15 @@ +#include <stdio.h> + +static void +printhello(char *hello[static 1]) +{ + puts(*hello); +} + +int +main(void) +{ + char *p = "Hello, world!"; + char *hello[] = {p}; + printhello(hello); +} diff --git a/tests/cc/execute/scc-tests.lst b/tests/cc/execute/scc-tests.lst @@ -92,6 +92,7 @@ 0097-extern.c 0098-tentative.c 0099-tentative.c +0102-decl.c [TODO] 0103-voidparm.c 0104-qbebug.c 0105-shl.c