More array declaration tests
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 31 Mar 2010 23:16:54 +0000 (16:16 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 31 Mar 2010 23:16:54 +0000 (16:16 -0700)
tests/array-09.glsl [new file with mode: 0644]
tests/array-10.glsl [new file with mode: 0644]
tests/array-11.glsl [new file with mode: 0644]
tests/array-12.glsl [new file with mode: 0644]
tests/array-13.glsl [new file with mode: 0644]

diff --git a/tests/array-09.glsl b/tests/array-09.glsl
new file mode 100644 (file)
index 0000000..cad6d0e
--- /dev/null
@@ -0,0 +1,9 @@
+#version 120
+/* PASS */
+
+void main()
+{
+  vec4 a[2] = vec4 [2] (vec4(1.0), vec4(2.0));
+
+  gl_Position = gl_Vertex;
+}
diff --git a/tests/array-10.glsl b/tests/array-10.glsl
new file mode 100644 (file)
index 0000000..019aa21
--- /dev/null
@@ -0,0 +1,11 @@
+/* FAIL - array constructors forbidden in GLSL 1.10
+ *
+ * This can also generate an error because the 'vec4[]' style syntax is
+ * illegal in GLSL 1.10.
+ */
+void main()
+{
+  vec4 a[2] = vec4 [2] (vec4(1.0), vec4(2.0));
+
+  gl_Position = gl_Vertex;
+}
diff --git a/tests/array-11.glsl b/tests/array-11.glsl
new file mode 100644 (file)
index 0000000..51d94e9
--- /dev/null
@@ -0,0 +1,9 @@
+#version 120
+/* PASS */
+
+void main()
+{
+  vec4 a[] = vec4 [] (vec4(1.0), vec4(2.0));
+
+  gl_Position = gl_Vertex;
+}
diff --git a/tests/array-12.glsl b/tests/array-12.glsl
new file mode 100644 (file)
index 0000000..7fc9579
--- /dev/null
@@ -0,0 +1,11 @@
+#version 120
+/* FAIL - array must have an implicit or explicit size */
+
+void main()
+{
+  vec4 a[];
+
+  a = vec4 [2] (vec4(1.0), vec4(2.0));
+
+  gl_Position = gl_Vertex;
+}
diff --git a/tests/array-13.glsl b/tests/array-13.glsl
new file mode 100644 (file)
index 0000000..cc7e29a
--- /dev/null
@@ -0,0 +1,11 @@
+#version 120
+/* PASS */
+
+void main()
+{
+  vec4 a[2];
+
+  a = vec4 [] (vec4(1.0), vec4(2.0));
+
+  gl_Position = gl_Vertex;
+}