new file mode 100644
@@ -0,0 +1,27 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 46 of the GLSL ES 1.00.17 spec:
+ *
+ * "Assignments of values to variables are performed using the assignment
+ * operator (=).
+ * ...
+ * and l-values dereferenced with the array subsript operator ([]) are
+ * all l-values."
+ */
+
+
+void main()
+{
+ vec4 a[2];
+ vec4 b[2];
+ vec4 c[2];
+
+ a = vec4[2](vec4(0.0), vec4(2.0));
+ b = vec4[ ](vec4(0.5), vec4(2.0));
+ c = a;
+
+ gl_Position = a[0] + b[0] + c[1];
+}
new file mode 100644
@@ -0,0 +1,17 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 24 of the GLSL ES 1.00.17 spec:
+ *
+ * "Only one-dimensional arrays may be declared."
+ */
+
+
+uniform vec4 [1] an_array[1];
+
+void main()
+{
+ gl_Position = an_array[0][0];
+}
new file mode 100644
@@ -0,0 +1,17 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 24 of the GLSL ES 1.00.17 spec:
+ *
+ * "Only one-dimensional arrays may be declared."
+ */
+
+
+uniform vec4 an_array[1][1];
+
+void main()
+{
+ gl_Position = an_array[0][0];
+}
new file mode 100644
@@ -0,0 +1,23 @@
+/* [config]
+ * expect_result: fail
+ * glsles_version: 1.00
+ * [end config]
+ *
+ * From page 48 of the GLSL ES 1.00.17 spec:
+ *
+ * "The arithmetic binary operators add (+), subtract (-), multiply (*),
+ * and divide (/) operate on integer and floating-point typed expressions
+ * (including vectors and matrices). The two operands must be of the same
+ * type or one can be a scalar float and the other a float vector or matrix
+ * or one can be a scalar integer and the other an integer vector."
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+void main()
+{
+ vec4 c[2] = a * b;
+ gl_Position = c[0];
+}
new file mode 100644
@@ -0,0 +1,28 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 48 GLSL ES 1.00.17 spec:
+ *
+ * "The equality operations equal (==) and not equal (!=) operate on all
+ * types execpt arrays, structures containing arrays...."
+ *
+ * Further "For vectors, matricies, and structures, all components of
+ * the operands must be equal for the operands to be considered equal."
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+void main()
+{
+ vec4 c[];
+
+ // Implicitly size c to match a and b.
+ c[0] = b[0];
+ c[1] = b[2];
+
+ gl_Position = vec4(a != c);
+}
new file mode 100644
@@ -0,0 +1,22 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 48 GLSL ES 1.00.17 spec:
+ *
+ * "The equality operations equal (==) and not equal (!=) operate on all
+ * types execpt arrays, structures containing arrays...."
+ *
+ * Further "For vectors, matricies, and structures, all components of
+ * the operands must be equal for the operands to be considered equal."
+ */
+
+
+uniform vec4 a[4];
+uniform mat4 b;
+
+void main()
+{
+ gl_Position = vec4(a != b);
+}
new file mode 100644
@@ -0,0 +1,22 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 48 GLSL ES 1.00.17 spec:
+ *
+ * "The equality operations equal (==) and not equal (!=) operate on all
+ * types execpt arrays, structures containing arrays...."
+ *
+ * Further "For vectors, matricies, and structures, all components of
+ * the operands must be equal for the operands to be considered equal."
+ */
+
+
+uniform vec4 a[2];
+uniform vec3 b[2]; // Note the differing base type
+
+void main()
+{
+ gl_Position = vec4(a != b);
+}
new file mode 100644
@@ -0,0 +1,22 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 48 GLSL ES 1.00.17 spec:
+ *
+ * "The equality operations equal (==) and not equal (!=) operate on all
+ * types execpt arrays, structures containing arrays...."
+ *
+ * Further "For vectors, matricies, and structures, all components of
+ * the operands must be equal for the operands to be considered equal."
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[3]; // Note the differing size
+
+void main()
+{
+ gl_Position = vec4(a != b);
+}
new file mode 100644
@@ -0,0 +1,22 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 48 GLSL ES 1.00.17 spec:
+ *
+ * "The equality operations equal (==) and not equal (!=) operate on all
+ * types execpt arrays, structures containing arrays...."
+ *
+ * Further "For vectors, matricies, and structures, all components of
+ * the operands must be equal for the operands to be considered equal."
+ */
+
+
+uniform float a[4];
+uniform vec4 b;
+
+void main()
+{
+ gl_Position = vec4(a != b);
+}
new file mode 100644
@@ -0,0 +1,22 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * Page 48 GLSL ES 1.00.17 spec:
+ *
+ * "The equality operations equal (==) and not equal (!=) operate on all
+ * types execpt arrays, structures containing arrays...."
+ *
+ * Further "For vectors, matricies, and structures, all components of
+ * the operands must be equal for the operands to be considered equal."
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+void main()
+{
+ gl_Position = vec4(a != b);
+}
Add to tests/spec/glsl-es-1.00/compiler/structure-and-array-operations glslparser tests for arrays and assignment, multidimensional, multiply, and not equal. Signed-off-by: Tom Gall <tom.gall@linaro.org> --- .../array-assign.vert | 27 +++++++++++++++++++ .../array-multidimensional-new-syntax.vert | 17 ++++++++++++ .../array-multidimensional.vert | 17 ++++++++++++ .../array-multiply.vert | 23 ++++++++++++++++ .../array-not-equal-implicit-size.vert | 28 ++++++++++++++++++++ .../array-not-equal-matrix.vert | 22 +++++++++++++++ .../array-not-equal-mismatched-base-type.vert | 22 +++++++++++++++ .../array-not-equal-mismatched-size.vert | 22 +++++++++++++++ .../array-not-equal-vertor.vert | 22 +++++++++++++++ .../array-not-equal.vert | 22 +++++++++++++++ 10 files changed, 222 insertions(+) create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-assign.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional-new-syntax.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multidimensional.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-multiply.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-implicit-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-matrix.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-base-type.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-mismatched-size.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal-vertor.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-not-equal.vert