]> git.draconx.ca Git - cdecl99.git/commitdiff
Add more type specifier tests.
authorNick Bowler <nbowler@draconx.ca>
Thu, 1 Jun 2023 04:53:26 +0000 (00:53 -0400)
committerNick Bowler <nbowler@draconx.ca>
Thu, 1 Jun 2023 04:56:01 +0000 (00:56 -0400)
Add some more coverage of invalid type specifier combinations to
support possible future changes in this area.

tests/decl-bad.at

index 2d357c9f17931d9f7c5d64bdd815376b68393e7f..c8b225e0cf32677571ec86b1a388f416c0e537ba 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright © 2020 Nick Bowler
+# Copyright © 2020, 2023 Nick Bowler
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -27,6 +27,8 @@ SIMPLE_BADDECL([Reject invalid identifiers],
   [explain int x$], [declare x$ as int])
 SIMPLE_BADDECL([Reject long long long],
   [explain long long long x], [declare x as long long long])
+SIMPLE_BADDECL([Reject long long double],
+  [explain long long double x], [declare x as long long double])
 SIMPLE_BADDECL([Reject inline on object declarations],
   [explain inline int x], [declare x as inline int])
 
@@ -42,7 +44,21 @@ SIMPLE_BADDECL([Reject implicit int],
 SIMPLE_BADDECL([Reject void declarations],
   [explain void x], [declare x as void])
 SIMPLE_BADDECL([Reject complex integers],
-  [explain int _Complex x], [declare x as int _Complex])
+  [explain int   _Complex x], [declare x as int   _Complex],
+  [explain short _Complex x], [declare x as short _Complex],
+  [explain long  _Complex x], [declare x as long  _Complex],
+  [explain char  _Complex x], [declare x as char  _Complex])
+SIMPLE_BADDECL([Reject imaginary integers],
+  [explain int   _Imaginary x], [declare x as int   _Imaginary],
+  [explain short _Imaginary x], [declare x as short _Imaginary],
+  [explain long  _Imaginary x], [declare x as long  _Imaginary],
+  [explain char  _Imaginary x], [declare x as char  _Imaginary])
+SIMPLE_BADDECL([Reject signed floats],
+  [explain signed float x],  [declare x as signed float],
+  [explain signed double x], [declare x as signed double])
+SIMPLE_BADDECL([Reject unsigned floats],
+  [explain unsigned float x],  [declare x as unsigned float],
+  [explain unsigned double x], [declare x as unsigned double])
 
 dnl C99§6.7.3p2: Types other than pointer types derived from object or
 dnl incomplete types shall not be restrict-qualified.