aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gall <tom.gall@linaro.org>2013-01-07 14:30:40 -0600
committerTom Gall <tom.gall@linaro.org>2013-01-23 14:08:50 -0600
commitfdbb11a291b94443c78faba86baf6e330fc51952 (patch)
treef1af96a26e2d1fda99841a0d738c86cf98ffa17e
parent378004376cdf8b98756d5f553d98f46be4373d55 (diff)
downloadpiglit-fdbb11a291b94443c78faba86baf6e330fc51952.tar.gz
gles2: add glslparser tests in
spec/glsl-es-1.00/compiler/assignment-operators ported to glsl es from spec/glsl-1.10.
-rw-r--r--tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-allowed.frag27
-rw-r--r--tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-allowed.vert28
-rw-r--r--tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-builtin-array-allowed.vert29
-rw-r--r--tests/spec/glsl-es-1.00/compiler/assignment-operators/modulus-assign-00.frag19
4 files changed, 103 insertions, 0 deletions
diff --git a/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-allowed.frag b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-allowed.frag
new file mode 100644
index 00000000..396aa929
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-allowed.frag
@@ -0,0 +1,27 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// glsles_version: 1.00
+// check_link: true
+// [end config]
+//
+// Check that assignment to an array is allowed in GLSL 1.20.
+//
+// From section 5.8 of the GLSL 1.20 spec:
+// Variables that are built-in types, entire structures or arrays,
+// structure fields, l-values with the field selector ( . )
+// applied to select components or swizzles without repeated
+// fields, l-values within parentheses, and l-values dereferenced
+// with the array subscript operator ( [] ) are all l-values.
+
+void f(float[2] x)
+{
+ float[2] y;
+ y = x;
+}
+
+void main()
+{
+ float[2] x;
+ f(x);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-allowed.vert b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-allowed.vert
new file mode 100644
index 00000000..557457fb
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-array-allowed.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// glsles_version: 1.00
+// check_link: true
+// [end config]
+//
+// Check that assignment to an array is allowed in GLSL 1.20.
+//
+// From section 5.8 of the GLSL 1.20 spec:
+// Variables that are built-in types, entire structures or arrays,
+// structure fields, l-values with the field selector ( . )
+// applied to select components or swizzles without repeated
+// fields, l-values within parentheses, and l-values dereferenced
+// with the array subscript operator ( [] ) are all l-values.
+
+void f(float[2] x)
+{
+ float[2] y;
+ y = x;
+}
+
+void main()
+{
+ float[2] x;
+ f(x);
+ gl_Position = vec4(0.0);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-builtin-array-allowed.vert b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-builtin-array-allowed.vert
new file mode 100644
index 00000000..9c321ec0
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/assignment-operators/assign-builtin-array-allowed.vert
@@ -0,0 +1,29 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.20
+// glsles_version: 1.00
+// check_link: true
+// [end config]
+//
+// Check that bulk assignment to a built-in array is allowed in GLSL 1.20.
+//
+// From section 5.8 of the GLSL 1.20 spec:
+// Variables that are built-in types, entire structures or arrays,
+// structure fields, l-values with the field selector ( . )
+// applied to select components or swizzles without repeated
+// fields, l-values within parentheses, and l-values dereferenced
+// with the array subscript operator ( [] ) are all l-values.
+
+varying vec4 gl_TexCoord[gl_MaxTextureCoords];
+
+void f(vec4[gl_MaxTextureCoords] x)
+{
+ gl_TexCoord = x;
+}
+
+void main()
+{
+ vec4[gl_MaxTextureCoords] x;
+ f(x);
+ gl_Position = vec4(0.0);
+}
diff --git a/tests/spec/glsl-es-1.00/compiler/assignment-operators/modulus-assign-00.frag b/tests/spec/glsl-es-1.00/compiler/assignment-operators/modulus-assign-00.frag
new file mode 100644
index 00000000..7d4a94b8
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/assignment-operators/modulus-assign-00.frag
@@ -0,0 +1,19 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.20
+// glsles_version: 1.00
+// [end config]
+//
+// The modulus assignment operator '%=' is reserved.
+//
+// From section 5.8 of the GLSL 1.20 spec:
+// The assignments modulus into (%=), left shift by (<<=), right shift by
+// (>>=), inclusive or into ( |=), and exclusive or into ( ^=). These
+// operators are reserved for future use.
+
+int
+f() {
+ int x = 19;
+ x %= 4;
+ return x;
+}