aboutsummaryrefslogtreecommitdiff
path: root/tests/tests2
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2016-03-24 15:44:01 +0100
committerMichael Matz <matz@suse.de>2016-03-24 15:44:01 +0100
commitf85db99ff0b48b5837fa985dcf9c58190b35f96a (patch)
treefdd6e4674aaae43b8fce39a08e581ab4c27c43b4 /tests/tests2
parentaa1ed616eb01efe353e7c5e829fffbed01b428bd (diff)
downloadtinycc-f85db99ff0b48b5837fa985dcf9c58190b35f96a.tar.gz
tinycc-f85db99ff0b48b5837fa985dcf9c58190b35f96a.tar.bz2
Fix type parsing
the check on incomplete struct/union/enum types was too early, disallowing mixed specifiers and qualifiers. Simply rely on the size (->c) field for that. See testcases.
Diffstat (limited to 'tests/tests2')
-rw-r--r--tests/tests2/61_undefined_enum.expect2
-rw-r--r--tests/tests2/81_types.c9
-rw-r--r--tests/tests2/81_types.expect0
3 files changed, 10 insertions, 1 deletions
diff --git a/tests/tests2/61_undefined_enum.expect b/tests/tests2/61_undefined_enum.expect
index 7ccdeca..eb8b774 100644
--- a/tests/tests2/61_undefined_enum.expect
+++ b/tests/tests2/61_undefined_enum.expect
@@ -1 +1 @@
-61_undefined_enum.c:1: error: unknown struct/union/enum
+61_undefined_enum.c:1: error: unknown type size
diff --git a/tests/tests2/81_types.c b/tests/tests2/81_types.c
new file mode 100644
index 0000000..542d066
--- /dev/null
+++ b/tests/tests2/81_types.c
@@ -0,0 +1,9 @@
+/* The following are all valid decls, even though some subtypes
+ are incomplete. */
+enum E *e;
+const enum E *e1;
+enum E const *e2;
+struct S *s;
+const struct S *s1;
+struct S const *s2;
+int main () { return 0; }
diff --git a/tests/tests2/81_types.expect b/tests/tests2/81_types.expect
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/tests2/81_types.expect