]> git.draconx.ca Git - cdecl99.git/commitdiff
Test more bogus declarations.
authorNick Bowler <nbowler@draconx.ca>
Wed, 28 Mar 2012 15:29:34 +0000 (11:29 -0400)
committerNick Bowler <nbowler@draconx.ca>
Wed, 28 Mar 2012 16:20:45 +0000 (12:20 -0400)
tests/cdecl99-c-invalid.sh

index e20af039296d0b0b30f35d58eb87929b0d4c6cc6..7aaba30310dc7954e556e8304d95cb8f925cb34e 100755 (executable)
@@ -21,22 +21,38 @@ test_decl() {
 }
 
 set -e
 }
 
 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 '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 _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(...)'
 # 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(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 '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[0]'
 test_decl 'void a[1]'
 test_decl 'int a[1](void)'
+test_decl 'int a[1nan]'
+test_decl 'int a[99999999999999999999999999999999999999999999999999999]'