From ff9043a061e58fc09d733996b185fdbc9a2a4b6f Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Wed, 28 Mar 2012 11:29:34 -0400 Subject: [PATCH] Test more bogus declarations. --- tests/cdecl99-c-invalid.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/cdecl99-c-invalid.sh b/tests/cdecl99-c-invalid.sh index e20af03..7aaba30 100755 --- a/tests/cdecl99-c-invalid.sh +++ b/tests/cdecl99-c-invalid.sh @@ -21,22 +21,38 @@ test_decl() { } set -e +test_decl 'int x$' +test_decl 'long long long x' test_decl 'inline int x' test_decl 'restrict int x' test_decl 'static auto int x' test_decl 'auto x' +test_decl 'void x' test_decl 'int _Complex x' test_decl 'typedef int' +test_decl 'int x, (void)' +test_decl 'int [5], (void)' test_decl 'void f(...)' # XXX: While these silly void-parameter declarations are "obviously" invalid, I # can't actually find a statement in the specification which forbids them. test_decl 'void f(void, void)' +test_decl 'void f(void, ...)' test_decl 'void f(register void)' test_decl 'void f(const void)' +test_decl 'void f(void const)' test_decl 'void f(const)' test_decl 'void f(typedef int x)' test_decl 'void f(static int x)' test_decl 'int f(void)[1]' +test_decl 'inline int (void)' +test_decl 'int f((x))' +test_decl 'int f, g((x))' +test_decl 'int f(void), g(...)' +test_decl 'int f(inline int g())' +test_decl 'int f(void)(void)' +test_decl 'int ((int))' test_decl 'int a[0]' test_decl 'void a[1]' test_decl 'int a[1](void)' +test_decl 'int a[1nan]' +test_decl 'int a[99999999999999999999999999999999999999999999999999999]' -- 2.43.0