scc

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

commit 1576c7ed09232d87b805f3e6a9d077ebbf3a6fc9
parent 89179cdedf9891d22418d07fe31e6e1ce87e55ee
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 26 Oct 2022 22:09:05 +0200

test/cc: Fix error/0020-storage.c

Diffstat:
Mtests/cc/error/0020-storage.c | 24++++++++++++++++++++----
Mtests/cc/error/scc-tests.lst | 2+-
2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/tests/cc/error/0020-storage.c b/tests/cc/error/0020-storage.c @@ -1,3 +1,14 @@ +/* +PATTERN: +0020-storage.c:36: warning: 'par' defined but not used +0020-storage.c:42: error: incorrect storage class for file-scope declaration +0020-storage.c:45: error: bad storage class in function parameter +0020-storage.c:46: error: invalid storage class for function 'func4' +0020-storage.c:47: error: invalid type specification +0020-storage.c:53: error: conflicting types for 'd' +. +*/ + int a; static char b; extern int c; @@ -11,26 +22,31 @@ func1(void) register long j; extern int k; static unsigned long a; - return 0; + return h+i+j+k+a; } -void +int func2(register int par) { int par; + + return par; } -static void +static int func3(register int par) { + return par; } register short d; -register void +register int func4(static int par) { static register f; + + return f+par; } short d; diff --git a/tests/cc/error/scc-tests.lst b/tests/cc/error/scc-tests.lst @@ -17,7 +17,7 @@ 0017-duplicatefunc.c 0018-voidparam.c 0019-kr_names.c -0020-storage.c [TODO] +0020-storage.c 0021-void.c [TODO] 0022-cpp-if.c [TODO] 0023-include.c [TODO]