more parsetests
authorMatthias Braun <matze@braunis.de>
Fri, 15 Feb 2008 10:57:36 +0000 (10:57 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 15 Feb 2008 10:57:36 +0000 (10:57 +0000)
[r18861]

parsetest/init3.c [new file with mode: 0644]
parsetest/init5.c [new file with mode: 0644]
parsetest/shouldfail/init2.c
parsetest/shouldfail/init3.c [new file with mode: 0644]
parsetest/shouldfail/init4.c [new file with mode: 0644]

diff --git a/parsetest/init3.c b/parsetest/init3.c
new file mode 100644 (file)
index 0000000..3cfe6ea
--- /dev/null
@@ -0,0 +1,12 @@
+typedef struct {
+       int a, b;
+} Stru1;
+
+typedef struct {
+       double d;
+       Stru1 stru;
+       float c;
+} Stru2;
+
+static const Stru1 k = { 4, 2 };
+static const Stru2 a = { 2.4, k, 0.4f };
diff --git a/parsetest/init5.c b/parsetest/init5.c
new file mode 100644 (file)
index 0000000..5dc54a7
--- /dev/null
@@ -0,0 +1,17 @@
+static const int l = 5;
+
+struct k {
+       int c, d;
+};
+
+struct S {
+       int a;
+       struct k k;
+};
+
+struct S arr[] = { 1, (struct k) { 4, 5 } };
+
+int main(void)
+{
+       return 0;
+}
index 9e2b90a..dbaaaab 100644 (file)
@@ -3,3 +3,8 @@ struct S {
 };
 
 struct S arr[] = { { 1, 2, { 3, 4 } } };
+
+int main(void)
+{
+       return 0;
+}
diff --git a/parsetest/shouldfail/init3.c b/parsetest/shouldfail/init3.c
new file mode 100644 (file)
index 0000000..1d910bb
--- /dev/null
@@ -0,0 +1,12 @@
+static const int l = 5;
+
+struct S {
+       int a, b;
+};
+
+struct S arr[] = { 1, l };
+
+int main(void)
+{
+       return 0;
+}
diff --git a/parsetest/shouldfail/init4.c b/parsetest/shouldfail/init4.c
new file mode 100644 (file)
index 0000000..97be0ef
--- /dev/null
@@ -0,0 +1,17 @@
+static const int l = 5;
+
+struct k {
+       int c, d;
+};
+
+struct S {
+       int a;
+       struct k k;
+};
+
+struct S arr[] = { 1, (struct k) { 4, l } };
+
+int main(void)
+{
+       return 0;
+}