new file mode 100644
@@ -0,0 +1,23 @@
+/* [config]
+ * expect_result: fail
+ * glsl_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,23 @@
+/* [config]
+ * expect_result: fail
+ * glsl_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,20 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 48 of the GLSL ES 1.00.17 spec:
+ *
+ * "The relational operators greater (>), less than (<), greater than or
+ * equal (>=), less than or equal (<=) operate only on scalar integer and
+ * scalar floating point expressions."
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+void main()
+{
+ gl_Position = vec4(a >= b);
+}
new file mode 100644
@@ -0,0 +1,20 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 48 of the GLSL ES 1.00.17 spec:
+ *
+ * "The relational operators greater (>), less than (<), greater than or
+ * equal (>=), less than or equal (<=) operate only on scalar integer and
+ * scalar floating point expressions."
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+void main()
+{
+ gl_Position = vec4(a > b);
+}
new file mode 100644
@@ -0,0 +1,20 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 48 of the GLSL ES 1.00.17 spec:
+ *
+ * "The relational operators greater (>), less than (<), greater than or
+ * equal (>=), less than or equal (<=) operate only on scalar integer and
+ * scalar floating point expressions."
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+void main()
+{
+ gl_Position = vec4(a <= b);
+}
new file mode 100644
@@ -0,0 +1,20 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 48 of the GLSL ES 1.00.17 spec:
+ *
+ * "The relational operators greater (>), less than (<), greater than or
+ * equal (>=), less than or equal (<=) operate only on scalar integer and
+ * scalar floating point expressions."
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+void main()
+{
+ gl_Position = vec4(a < b);
+}
new file mode 100644
@@ -0,0 +1,20 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 48 of the GLSL ES 1.00.17 spec:
+ *
+ * "The logical binary operators and (&&), or (||), and exclusive or (^^)
+ * operate only one two Boolean expressions and result in a Boolean
+ * expression.
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+void main()
+{
+ gl_Position = vec4(a && b);
+}
new file mode 100644
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 48 of the GLSL ES 1.00.17 spec:
+ *
+ * "The logical unary operator not (!) operates only on a Boolean expression
+ * and results in a Boolean expression.
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+void main()
+{
+ gl_Position = vec4(!a);
+}
new file mode 100644
@@ -0,0 +1,20 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 48 of the GLSL ES 1.00.17 spec:
+ *
+ * "The logical binary operators and (&&), or (||), and exclusive or (^^)
+ * operate only one two Boolean expressions and result in a Boolean
+ * expression.
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+void main()
+{
+ gl_Position = vec4(a || b);
+}
new file mode 100644
@@ -0,0 +1,20 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 48 of the GLSL ES 1.00.17 spec:
+ *
+ * "The logical binary operators and (&&), or (||), and exclusive or (^^)
+ * operate only one two Boolean expressions and result in a Boolean
+ * expression.
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+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]
+ *
+ * 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()
+{
+ gl_Position = vec4(-a == b);
+}
new file mode 100644
@@ -0,0 +1,22 @@
+/* [config]
+ * expect_result: fail
+ * glsl_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()
+{
+ gl_Position = vec4(+a == b);
+}
new file mode 100644
@@ -0,0 +1,21 @@
+/* [config]
+ * expect_result: fail
+ * glsl_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];
+
+void main()
+{
+ gl_Position = (a--)[0];
+}
new file mode 100644
@@ -0,0 +1,21 @@
+/* [config]
+ * expect_result: fail
+ * glsl_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];
+
+void main()
+{
+ gl_Position = (a++)[0];
+}
new file mode 100644
@@ -0,0 +1,26 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 49 of the GLSL ES 1.00.17 spec:
+ *
+ * "The ternary selection operator (?:). It operates on three expressions
+ * (exp1 ? exp2 : exp3). This operator evaluates the first expression,
+ * which must result in a scalar Boolean. If the result is true, it
+ * selects to evaluate the second expression, otherwise it selects to
+ * evaluate the third expression. One one of the second or third expressions
+ * is evaluated. The second and third expressions must be the same type, but
+ * can be of any type other than an array."
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+uniform int i;
+uniform bool pick_from_a_or_b;
+
+void main()
+{
+ gl_Position = (pick_from_a_or_b ? a : b)[i];
+}
new file mode 100644
@@ -0,0 +1,20 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.00
+ * [end config]
+ *
+ * From page 48 of the GLSL ES 1.00.17 spec:
+ *
+ * "The sequence operator (,) that operates on expressions by returning the
+ * type and value of the right-most expression in a comma separated list of
+ * expressions. All expressions are evaluated, in order, from right to left.
+ */
+
+
+uniform vec4 a[2];
+uniform vec4 b[2];
+
+void main()
+{
+ gl_Position = (a, b)[0];
+}
new file mode 100644
@@ -0,0 +1,23 @@
+/* [config]
+ * expect_result: fail
+ * glsl_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];
+}
Add to tests/spec/glsl-es-1.00/compiler/structure-and-array-operations a series of array operator tests including logical and mathimatical tests. These are operators including +,/,>,<,>=,<=,&&,!,||,^^,+,-,++,--, , ,- Signed-off-by: Tom Gall <tom.gall@linaro.org> --- .../structure-and-array-operations/array-add.vert | 23 +++++++++++++++++ .../array-divide.vert | 23 +++++++++++++++++ .../array-greater-equal.vert | 20 +++++++++++++++ .../array-greater.vert | 20 +++++++++++++++ .../array-less-equal.vert | 20 +++++++++++++++ .../structure-and-array-operations/array-less.vert | 20 +++++++++++++++ .../array-logical-and.vert | 20 +++++++++++++++ .../array-logical-not.vert | 19 ++++++++++++++ .../array-logical-or.vert | 20 +++++++++++++++ .../array-logical-xor.vert | 20 +++++++++++++++ .../array-negate.vert | 22 +++++++++++++++++ .../array-positive.vert | 22 +++++++++++++++++ .../array-postdecrement.vert | 21 ++++++++++++++++ .../array-postincrement.vert | 21 ++++++++++++++++ .../array-selection.vert | 26 ++++++++++++++++++++ .../array-sequence.vert | 20 +++++++++++++++ .../array-subtract.vert | 23 +++++++++++++++++ 17 files changed, 360 insertions(+) create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-add.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-divide.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater-equal.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-greater.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less-equal.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-less.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-and.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-not.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-or.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-logical-xor.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-negate.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-positive.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postdecrement.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-postincrement.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-selection.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-sequence.vert create mode 100644 tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-subtract.vert