aboutsummaryrefslogtreecommitdiff
path: root/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-shadow-redeclaration.vert
diff options
context:
space:
mode:
Diffstat (limited to 'tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-shadow-redeclaration.vert')
-rw-r--r--tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-shadow-redeclaration.vert29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-shadow-redeclaration.vert b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-shadow-redeclaration.vert
new file mode 100644
index 00000000..f691fd8d
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-shadow-redeclaration.vert
@@ -0,0 +1,29 @@
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.20
+ * glsles_version: 1.00
+ * [end config]
+ *
+ * From page 21 (page 27 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "An implicitly sized array can be re-declared in the same scope
+ * as an array of the same base type."
+ */
+
+
+attribute vec4 v;
+
+void main()
+{
+ float a[];
+
+ a[3] = 1.2; // Implicitly size "a" to have 4 elements.
+
+ {
+ float a[4]; // this declaration shadows the previous
+ }
+
+ a.length(); // illegal - "a' is not explicitly sized
+
+ gl_Position = v;
+}