Paul Berry | 6 Jan 20:33 2012
Picon

Re: [PATCH 8/8] glsl-1.10: Verify that postdecrement is not an l-value for function out parameters

On 23 December 2011 14:48, Ian Romanick <idr-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org> wrote:

From: Ian Romanick <ian.d.romanick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Signed-off-by: Ian Romanick <ian.d.romanick-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43975
---
 ...ecrement-float-out-parameter-not-an-lvalue.frag |   31 ++++++++++++++++++++
 ...ecrement-float-out-parameter-not-an-lvalue.vert |   31 ++++++++++++++++++++
 ...tdecrement-int-out-parameter-not-an-lvalue.frag |   31 ++++++++++++++++++++
 ...tdecrement-int-out-parameter-not-an-lvalue.vert |   31 ++++++++++++++++++++
 ...ecrement-ivec2-out-parameter-not-an-lvalue.frag |   31 ++++++++++++++++++++
 ...ecrement-ivec2-out-parameter-not-an-lvalue.vert |   31 ++++++++++++++++++++
 ...ecrement-ivec3-out-parameter-not-an-lvalue.frag |   31 ++++++++++++++++++++
 ...ecrement-ivec3-out-parameter-not-an-lvalue.vert |   31 ++++++++++++++++++++
 ...ecrement-ivec4-out-parameter-not-an-lvalue.frag |   31 ++++++++++++++++++++
 ...ecrement-ivec4-out-parameter-not-an-lvalue.vert |   31 ++++++++++++++++++++
 ...decrement-vec2-out-parameter-not-an-lvalue.frag |   31 ++++++++++++++++++++
 ...decrement-vec2-out-parameter-not-an-lvalue.vert |   31 ++++++++++++++++++++
 ...decrement-vec3-out-parameter-not-an-lvalue.frag |   31 ++++++++++++++++++++
 ...decrement-vec3-out-parameter-not-an-lvalue.vert |   31 ++++++++++++++++++++
 ...decrement-vec4-out-parameter-not-an-lvalue.frag |   31 ++++++++++++++++++++
 ...decrement-vec4-out-parameter-not-an-lvalue.vert |   31 ++++++++++++++++++++
 16 files changed, 496 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-float-out-parameter-not-an-lvalue.frag
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-float-out-parameter-not-an-lvalue.vert
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-int-out-parameter-not-an-lvalue.frag
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-int-out-parameter-not-an-lvalue.vert
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec2-out-parameter-not-an-lvalue.frag
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec2-out-parameter-not-an-lvalue.vert
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec3-out-parameter-not-an-lvalue.frag
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec3-out-parameter-not-an-lvalue.vert
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec4-out-parameter-not-an-lvalue.frag
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec4-out-parameter-not-an-lvalue.vert
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec2-out-parameter-not-an-lvalue.frag
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec2-out-parameter-not-an-lvalue.vert
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec3-out-parameter-not-an-lvalue.frag
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec3-out-parameter-not-an-lvalue.vert
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec4-out-parameter-not-an-lvalue.frag
 create mode 100644 tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec4-out-parameter-not-an-lvalue.vert

Personally, I would have preferred to have the tests in this series generated at piglit build time by a Python script (like the scripts in generated_tests/), with an example of one of the generated tests in the commit message to make review easier.  Especially since if we do find a problem in the tests later, it would be much easier to modify the script than to change all the tests.  But I'm not going to ask you to spend a lot of time reworking things, especially given how long it took me to get around to reviewing these patches.

Acked-by: Paul Berry <stereotype441-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

 

diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-float-out-parameter-not-an-lvalue.frag b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-float-out-parameter-not-an-lvalue.frag
new file mode 100644
index 0000000..939475d
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-float-out-parameter-not-an-lvalue.frag
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform float u;
+varying vec4 v;
+
+void f(out float p)
+{
+    p = float(v.x);
+}
+
+void main()
+{
+    float t = u;
+
+    f(t--);
+    gl_FragColor = vec4(t, v.yzw);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-float-out-parameter-not-an-lvalue.vert b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-float-out-parameter-not-an-lvalue.vert
new file mode 100644
index 0000000..3f9b1c3
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-float-out-parameter-not-an-lvalue.vert
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform float u;
+attribute vec4 v;
+
+void f(out float p)
+{
+    p = float(v.x);
+}
+
+void main()
+{
+    float t = u;
+
+    f(t--);
+    gl_Position = vec4(t, v.yzw);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-int-out-parameter-not-an-lvalue.frag b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-int-out-parameter-not-an-lvalue.frag
new file mode 100644
index 0000000..897561b
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-int-out-parameter-not-an-lvalue.frag
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform int u;
+varying vec4 v;
+
+void f(out int p)
+{
+    p = int(v.x);
+}
+
+void main()
+{
+    int t = u;
+
+    f(t--);
+    gl_FragColor = vec4(t, v.yzw);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-int-out-parameter-not-an-lvalue.vert b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-int-out-parameter-not-an-lvalue.vert
new file mode 100644
index 0000000..c297ca2
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-int-out-parameter-not-an-lvalue.vert
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform int u;
+attribute vec4 v;
+
+void f(out int p)
+{
+    p = int(v.x);
+}
+
+void main()
+{
+    int t = u;
+
+    f(t--);
+    gl_Position = vec4(t, v.yzw);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec2-out-parameter-not-an-lvalue.frag b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec2-out-parameter-not-an-lvalue.frag
new file mode 100644
index 0000000..cefed6b
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec2-out-parameter-not-an-lvalue.frag
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform ivec2 u;
+varying vec4 v;
+
+void f(out ivec2 p)
+{
+    p = ivec2(v.xy);
+}
+
+void main()
+{
+    ivec2 t = u;
+
+    f(t--);
+    gl_FragColor = vec4(t, v.zw);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec2-out-parameter-not-an-lvalue.vert b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec2-out-parameter-not-an-lvalue.vert
new file mode 100644
index 0000000..ccb88b9
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec2-out-parameter-not-an-lvalue.vert
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform ivec2 u;
+attribute vec4 v;
+
+void f(out ivec2 p)
+{
+    p = ivec2(v.xy);
+}
+
+void main()
+{
+    ivec2 t = u;
+
+    f(t--);
+    gl_Position = vec4(t, v.zw);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec3-out-parameter-not-an-lvalue.frag b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec3-out-parameter-not-an-lvalue.frag
new file mode 100644
index 0000000..86b89a6
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec3-out-parameter-not-an-lvalue.frag
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform ivec3 u;
+varying vec4 v;
+
+void f(out ivec3 p)
+{
+    p = ivec3(v.xyz);
+}
+
+void main()
+{
+    ivec3 t = u;
+
+    f(t--);
+    gl_FragColor = vec4(t, v.w);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec3-out-parameter-not-an-lvalue.vert b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec3-out-parameter-not-an-lvalue.vert
new file mode 100644
index 0000000..037b316
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec3-out-parameter-not-an-lvalue.vert
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform ivec3 u;
+attribute vec4 v;
+
+void f(out ivec3 p)
+{
+    p = ivec3(v.xyz);
+}
+
+void main()
+{
+    ivec3 t = u;
+
+    f(t--);
+    gl_Position = vec4(t, v.w);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec4-out-parameter-not-an-lvalue.frag b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec4-out-parameter-not-an-lvalue.frag
new file mode 100644
index 0000000..3a85cc5
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec4-out-parameter-not-an-lvalue.frag
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform ivec4 u;
+varying vec4 v;
+
+void f(out ivec4 p)
+{
+    p = ivec4(v);
+}
+
+void main()
+{
+    ivec4 t = u;
+
+    f(t--);
+    gl_FragColor = vec4(t);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec4-out-parameter-not-an-lvalue.vert b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec4-out-parameter-not-an-lvalue.vert
new file mode 100644
index 0000000..ce4b770
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-ivec4-out-parameter-not-an-lvalue.vert
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform ivec4 u;
+attribute vec4 v;
+
+void f(out ivec4 p)
+{
+    p = ivec4(v);
+}
+
+void main()
+{
+    ivec4 t = u;
+
+    f(t--);
+    gl_Position = vec4(t);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec2-out-parameter-not-an-lvalue.frag b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec2-out-parameter-not-an-lvalue.frag
new file mode 100644
index 0000000..1a5a5c9
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec2-out-parameter-not-an-lvalue.frag
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform vec2 u;
+varying vec4 v;
+
+void f(out vec2 p)
+{
+    p = vec2(v.xy);
+}
+
+void main()
+{
+    vec2 t = u;
+
+    f(t--);
+    gl_FragColor = vec4(t, v.zw);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec2-out-parameter-not-an-lvalue.vert b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec2-out-parameter-not-an-lvalue.vert
new file mode 100644
index 0000000..6eddb0b
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec2-out-parameter-not-an-lvalue.vert
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform vec2 u;
+attribute vec4 v;
+
+void f(out vec2 p)
+{
+    p = vec2(v.xy);
+}
+
+void main()
+{
+    vec2 t = u;
+
+    f(t--);
+    gl_Position = vec4(t, v.zw);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec3-out-parameter-not-an-lvalue.frag b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec3-out-parameter-not-an-lvalue.frag
new file mode 100644
index 0000000..2d1af79
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec3-out-parameter-not-an-lvalue.frag
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform vec3 u;
+varying vec4 v;
+
+void f(out vec3 p)
+{
+    p = vec3(v.xyz);
+}
+
+void main()
+{
+    vec3 t = u;
+
+    f(t--);
+    gl_FragColor = vec4(t, v.w);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec3-out-parameter-not-an-lvalue.vert b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec3-out-parameter-not-an-lvalue.vert
new file mode 100644
index 0000000..7b6a1e5
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec3-out-parameter-not-an-lvalue.vert
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform vec3 u;
+attribute vec4 v;
+
+void f(out vec3 p)
+{
+    p = vec3(v.xyz);
+}
+
+void main()
+{
+    vec3 t = u;
+
+    f(t--);
+    gl_Position = vec4(t, v.w);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec4-out-parameter-not-an-lvalue.frag b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec4-out-parameter-not-an-lvalue.frag
new file mode 100644
index 0000000..ca761c8
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec4-out-parameter-not-an-lvalue.frag
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform vec4 u;
+varying vec4 v;
+
+void f(out vec4 p)
+{
+    p = vec4(v);
+}
+
+void main()
+{
+    vec4 t = u;
+
+    f(t--);
+    gl_FragColor = vec4(t);
+}
diff --git a/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec4-out-parameter-not-an-lvalue.vert b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec4-out-parameter-not-an-lvalue.vert
new file mode 100644
index 0000000..bc7bd1f
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/expressions/postdecrement-vec4-out-parameter-not-an-lvalue.vert
<at> <at> -0,0 +1,31 <at> <at>
+/* [config]
+ * expect_result: fail
+ * glsl_version: 1.10
+ * [end config]
+ *
+ * Page 32 (page 38 of the PDF) of the GLSL 1.10 spec says:
+ *
+ *     "Variables that are built-in types, entire structures, structure
+ *     fields, l-values with the field selector ( . ) applied to select
+ *     components or swizzles without repeated fields, and l-values
+ *     dereferenced with the array subscript operator ( [ ] ) are all
+ *     l-values. Other binary or unary expressions, non-dereferenced arrays,
+ *     function names, swizzles with repeated fields, and constants cannot be
+ *     l-values.  The ternary operator (?:) is also not allowed as an
+ *     l-value."
+ */
+uniform vec4 u;
+attribute vec4 v;
+
+void f(out vec4 p)
+{
+    p = vec4(v);
+}
+
+void main()
+{
+    vec4 t = u;
+
+    f(t--);
+    gl_Position = vec4(t);
+}
--
1.7.6.4

_______________________________________________
Piglit mailing list
Piglit-PD4FTy7X32lNgt0PjOBp9/EVdHwE84te@public.gmane.orgg
http://lists.freedesktop.org/mailman/listinfo/piglit

_______________________________________________
Piglit mailing list
Piglit@...
http://lists.freedesktop.org/mailman/listinfo/piglit

Gmane