summaryrefslogtreecommitdiffstats
path: root/src/glsl/tests
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2010-09-02 18:31:49 +0200
committerChristoph Bumiller <[email protected]>2010-09-02 18:31:49 +0200
commit222d2f2ac2c7d93cbc0643082c78278ad2c8cfce (patch)
treeb79152c238022b2a901201c22e5809ac520732bf /src/glsl/tests
parent443abc80db9e1a288ce770e76cccd43664348098 (diff)
parente73c5501b2fe20290d1b691c85a5d82ac3a0431c (diff)
Merge remote branch 'origin/master' into nv50-compiler
Conflicts: src/gallium/drivers/nv50/nv50_program.c
Diffstat (limited to 'src/glsl/tests')
-rw-r--r--src/glsl/tests/array-01.glsl3
-rw-r--r--src/glsl/tests/array-02.glsl3
-rw-r--r--src/glsl/tests/array-03.glsl3
-rw-r--r--src/glsl/tests/array-04.glsl2
-rw-r--r--src/glsl/tests/array-05.glsl2
-rw-r--r--src/glsl/tests/array-06.glsl2
-rw-r--r--src/glsl/tests/array-07.glsl2
-rw-r--r--src/glsl/tests/array-08.glsl2
-rw-r--r--src/glsl/tests/array-09.glsl9
-rw-r--r--src/glsl/tests/array-10.glsl11
-rw-r--r--src/glsl/tests/array-11.glsl9
-rw-r--r--src/glsl/tests/array-12.glsl11
-rw-r--r--src/glsl/tests/array-13.glsl11
-rw-r--r--src/glsl/tests/attribute-01.glsl7
-rw-r--r--src/glsl/tests/attribute-02.glsl7
-rw-r--r--src/glsl/tests/attribute-03.glsl7
-rw-r--r--src/glsl/tests/attribute-04.glsl7
-rw-r--r--src/glsl/tests/attribute-05.glsl7
-rw-r--r--src/glsl/tests/attribute-06.glsl7
-rw-r--r--src/glsl/tests/attribute-07.glsl7
-rw-r--r--src/glsl/tests/attribute-08.glsl7
-rw-r--r--src/glsl/tests/attribute-09.glsl7
-rw-r--r--src/glsl/tests/attribute-10.glsl8
-rw-r--r--src/glsl/tests/attribute-11.glsl8
-rw-r--r--src/glsl/tests/condition-01.glsl8
-rw-r--r--src/glsl/tests/condition-02.glsl8
-rw-r--r--src/glsl/tests/condition-03.glsl8
-rw-r--r--src/glsl/tests/condition-04.glsl8
-rw-r--r--src/glsl/tests/condition-05.glsl13
-rw-r--r--src/glsl/tests/constructor-01.glsl6
-rw-r--r--src/glsl/tests/constructor-02.glsl7
-rw-r--r--src/glsl/tests/constructor-03.glsl12
-rw-r--r--src/glsl/tests/constructor-04.glsl14
-rw-r--r--src/glsl/tests/constructor-05.glsl13
-rw-r--r--src/glsl/tests/constructor-06.glsl13
-rw-r--r--src/glsl/tests/constructor-07.glsl13
-rw-r--r--src/glsl/tests/constructor-08.glsl13
-rw-r--r--src/glsl/tests/constructor-09.glsl26
-rw-r--r--src/glsl/tests/function-01.glsl16
-rw-r--r--src/glsl/tests/function-02.glsl16
-rw-r--r--src/glsl/tests/function-03.glsl16
-rw-r--r--src/glsl/tests/function-04.glsl15
-rw-r--r--src/glsl/tests/function-05.glsl26
-rw-r--r--src/glsl/tests/if-01.glsl11
-rw-r--r--src/glsl/tests/if-02.glsl11
-rw-r--r--src/glsl/tests/if-03.glsl11
-rw-r--r--src/glsl/tests/if-04.glsl11
-rw-r--r--src/glsl/tests/matrix-01.glsl6
-rw-r--r--src/glsl/tests/matrix-02.glsl6
-rw-r--r--src/glsl/tests/matrix-03.glsl6
-rw-r--r--src/glsl/tests/matrix-04.glsl6
-rw-r--r--src/glsl/tests/matrix-05.glsl6
-rw-r--r--src/glsl/tests/matrix-06.glsl6
-rw-r--r--src/glsl/tests/matrix-07.glsl27
-rw-r--r--src/glsl/tests/matrix-08.glsl19
-rw-r--r--src/glsl/tests/matrix-09.glsl11
-rw-r--r--src/glsl/tests/matrix-10.glsl12
-rw-r--r--src/glsl/tests/parameters-01.glsl11
-rw-r--r--src/glsl/tests/parameters-02.glsl11
-rw-r--r--src/glsl/tests/parameters-03.glsl9
-rw-r--r--src/glsl/tests/qualifier-01.glsl3
-rw-r--r--src/glsl/tests/qualifier-02.glsl2
-rw-r--r--src/glsl/tests/qualifier-03.glsl2
-rw-r--r--src/glsl/tests/qualifier-04.glsl3
-rw-r--r--src/glsl/tests/qualifier-05.glsl3
-rw-r--r--src/glsl/tests/qualifier-06.glsl7
-rw-r--r--src/glsl/tests/qualifier-07.glsl7
-rw-r--r--src/glsl/tests/swiz-01.glsl11
-rw-r--r--src/glsl/tests/swiz-02.glsl11
-rw-r--r--src/glsl/tests/void-01.glsl2
70 files changed, 631 insertions, 0 deletions
diff --git a/src/glsl/tests/array-01.glsl b/src/glsl/tests/array-01.glsl
new file mode 100644
index 00000000000..d14135fb3a8
--- /dev/null
+++ b/src/glsl/tests/array-01.glsl
@@ -0,0 +1,3 @@
+#version 120
+/* FAIL - array size type must be int */
+uniform vec4 [3.2] a;
diff --git a/src/glsl/tests/array-02.glsl b/src/glsl/tests/array-02.glsl
new file mode 100644
index 00000000000..d743617158d
--- /dev/null
+++ b/src/glsl/tests/array-02.glsl
@@ -0,0 +1,3 @@
+#version 120
+/* FAIL - array size type must be scalar */
+uniform vec4 [ivec4(3)] a;
diff --git a/src/glsl/tests/array-03.glsl b/src/glsl/tests/array-03.glsl
new file mode 100644
index 00000000000..0026913f019
--- /dev/null
+++ b/src/glsl/tests/array-03.glsl
@@ -0,0 +1,3 @@
+#version 120
+/* PASS */
+uniform vec4 [3] a;
diff --git a/src/glsl/tests/array-04.glsl b/src/glsl/tests/array-04.glsl
new file mode 100644
index 00000000000..70f434d8ab6
--- /dev/null
+++ b/src/glsl/tests/array-04.glsl
@@ -0,0 +1,2 @@
+/* FAIL - array size type must be int */
+uniform vec4 a[3.2];
diff --git a/src/glsl/tests/array-05.glsl b/src/glsl/tests/array-05.glsl
new file mode 100644
index 00000000000..168704096b0
--- /dev/null
+++ b/src/glsl/tests/array-05.glsl
@@ -0,0 +1,2 @@
+/* FAIL - array size type must be scalar */
+uniform vec4 a[ivec4(3)];
diff --git a/src/glsl/tests/array-06.glsl b/src/glsl/tests/array-06.glsl
new file mode 100644
index 00000000000..46b43795be1
--- /dev/null
+++ b/src/glsl/tests/array-06.glsl
@@ -0,0 +1,2 @@
+/* PASS */
+uniform vec4 a[3];
diff --git a/src/glsl/tests/array-07.glsl b/src/glsl/tests/array-07.glsl
new file mode 100644
index 00000000000..161ffbf2f2e
--- /dev/null
+++ b/src/glsl/tests/array-07.glsl
@@ -0,0 +1,2 @@
+/* FAIL - array size must be > 0 */
+uniform vec4 a[0];
diff --git a/src/glsl/tests/array-08.glsl b/src/glsl/tests/array-08.glsl
new file mode 100644
index 00000000000..4bf0c6bd513
--- /dev/null
+++ b/src/glsl/tests/array-08.glsl
@@ -0,0 +1,2 @@
+/* FAIL - array size must be > 0 */
+uniform vec4 a[-1];
diff --git a/src/glsl/tests/array-09.glsl b/src/glsl/tests/array-09.glsl
new file mode 100644
index 00000000000..cad6d0e54ec
--- /dev/null
+++ b/src/glsl/tests/array-09.glsl
@@ -0,0 +1,9 @@
+#version 120
+/* PASS */
+
+void main()
+{
+ vec4 a[2] = vec4 [2] (vec4(1.0), vec4(2.0));
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/array-10.glsl b/src/glsl/tests/array-10.glsl
new file mode 100644
index 00000000000..019aa21150f
--- /dev/null
+++ b/src/glsl/tests/array-10.glsl
@@ -0,0 +1,11 @@
+/* FAIL - array constructors forbidden in GLSL 1.10
+ *
+ * This can also generate an error because the 'vec4[]' style syntax is
+ * illegal in GLSL 1.10.
+ */
+void main()
+{
+ vec4 a[2] = vec4 [2] (vec4(1.0), vec4(2.0));
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/array-11.glsl b/src/glsl/tests/array-11.glsl
new file mode 100644
index 00000000000..51d94e94773
--- /dev/null
+++ b/src/glsl/tests/array-11.glsl
@@ -0,0 +1,9 @@
+#version 120
+/* PASS */
+
+void main()
+{
+ vec4 a[] = vec4 [] (vec4(1.0), vec4(2.0));
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/array-12.glsl b/src/glsl/tests/array-12.glsl
new file mode 100644
index 00000000000..7fc9579452f
--- /dev/null
+++ b/src/glsl/tests/array-12.glsl
@@ -0,0 +1,11 @@
+#version 120
+/* FAIL - array must have an implicit or explicit size */
+
+void main()
+{
+ vec4 a[];
+
+ a = vec4 [2] (vec4(1.0), vec4(2.0));
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/array-13.glsl b/src/glsl/tests/array-13.glsl
new file mode 100644
index 00000000000..cc7e29a5f76
--- /dev/null
+++ b/src/glsl/tests/array-13.glsl
@@ -0,0 +1,11 @@
+#version 120
+/* PASS */
+
+void main()
+{
+ vec4 a[2];
+
+ a = vec4 [] (vec4(1.0), vec4(2.0));
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/attribute-01.glsl b/src/glsl/tests/attribute-01.glsl
new file mode 100644
index 00000000000..18e9e4468aa
--- /dev/null
+++ b/src/glsl/tests/attribute-01.glsl
@@ -0,0 +1,7 @@
+/* FAIL - attribute cannot have type int */
+attribute int i;
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
diff --git a/src/glsl/tests/attribute-02.glsl b/src/glsl/tests/attribute-02.glsl
new file mode 100644
index 00000000000..6b6df74d252
--- /dev/null
+++ b/src/glsl/tests/attribute-02.glsl
@@ -0,0 +1,7 @@
+/* FAIL - attribute cannot have type ivec2 */
+attribute ivec2 i;
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
diff --git a/src/glsl/tests/attribute-03.glsl b/src/glsl/tests/attribute-03.glsl
new file mode 100644
index 00000000000..870de9e8148
--- /dev/null
+++ b/src/glsl/tests/attribute-03.glsl
@@ -0,0 +1,7 @@
+/* FAIL - attribute cannot have type ivec3 */
+attribute ivec3 i;
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
diff --git a/src/glsl/tests/attribute-04.glsl b/src/glsl/tests/attribute-04.glsl
new file mode 100644
index 00000000000..14af2fcaadd
--- /dev/null
+++ b/src/glsl/tests/attribute-04.glsl
@@ -0,0 +1,7 @@
+/* FAIL - attribute cannot have type ivec4 */
+attribute ivec4 i;
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
diff --git a/src/glsl/tests/attribute-05.glsl b/src/glsl/tests/attribute-05.glsl
new file mode 100644
index 00000000000..18822c78541
--- /dev/null
+++ b/src/glsl/tests/attribute-05.glsl
@@ -0,0 +1,7 @@
+/* FAIL - attribute cannot have type bool */
+attribute bool i;
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
diff --git a/src/glsl/tests/attribute-06.glsl b/src/glsl/tests/attribute-06.glsl
new file mode 100644
index 00000000000..f18027b81af
--- /dev/null
+++ b/src/glsl/tests/attribute-06.glsl
@@ -0,0 +1,7 @@
+/* FAIL - attribute cannot have type bvec2 */
+attribute bvec2 i;
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
diff --git a/src/glsl/tests/attribute-07.glsl b/src/glsl/tests/attribute-07.glsl
new file mode 100644
index 00000000000..0af13ba84bf
--- /dev/null
+++ b/src/glsl/tests/attribute-07.glsl
@@ -0,0 +1,7 @@
+/* FAIL - attribute cannot have type bvec3 */
+attribute bvec3 i;
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
diff --git a/src/glsl/tests/attribute-08.glsl b/src/glsl/tests/attribute-08.glsl
new file mode 100644
index 00000000000..b069c04d1b4
--- /dev/null
+++ b/src/glsl/tests/attribute-08.glsl
@@ -0,0 +1,7 @@
+/* FAIL - attribute cannot have type bvec4 */
+attribute bvec4 i;
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
diff --git a/src/glsl/tests/attribute-09.glsl b/src/glsl/tests/attribute-09.glsl
new file mode 100644
index 00000000000..6a607244b9a
--- /dev/null
+++ b/src/glsl/tests/attribute-09.glsl
@@ -0,0 +1,7 @@
+/* FAIL - attribute cannot have array type in GLSL 1.10 */
+attribute vec4 i[10];
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
diff --git a/src/glsl/tests/attribute-10.glsl b/src/glsl/tests/attribute-10.glsl
new file mode 100644
index 00000000000..6f5ef63a015
--- /dev/null
+++ b/src/glsl/tests/attribute-10.glsl
@@ -0,0 +1,8 @@
+#version 120
+/* FAIL - attribute cannot have array type in GLSL 1.20 */
+attribute vec4 i[10];
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
diff --git a/src/glsl/tests/attribute-11.glsl b/src/glsl/tests/attribute-11.glsl
new file mode 100644
index 00000000000..47cb5a05833
--- /dev/null
+++ b/src/glsl/tests/attribute-11.glsl
@@ -0,0 +1,8 @@
+#version 130
+/* FAIL - attribute cannot have array type in GLSL 1.30 */
+attribute vec4 i[10];
+
+void main()
+{
+ gl_Position = vec4(1.0);
+}
diff --git a/src/glsl/tests/condition-01.glsl b/src/glsl/tests/condition-01.glsl
new file mode 100644
index 00000000000..d89c313117e
--- /dev/null
+++ b/src/glsl/tests/condition-01.glsl
@@ -0,0 +1,8 @@
+/* FAIL - :? condition is not bool scalar */
+
+uniform bvec4 a;
+
+void main()
+{
+ gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec4(0.0, 1.0, 0.0, 1.0);
+}
diff --git a/src/glsl/tests/condition-02.glsl b/src/glsl/tests/condition-02.glsl
new file mode 100644
index 00000000000..cbd0e18d9a8
--- /dev/null
+++ b/src/glsl/tests/condition-02.glsl
@@ -0,0 +1,8 @@
+/* FAIL - :? condition is not bool scalar */
+
+uniform float a;
+
+void main()
+{
+ gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec4(0.0, 1.0, 0.0, 1.0);
+}
diff --git a/src/glsl/tests/condition-03.glsl b/src/glsl/tests/condition-03.glsl
new file mode 100644
index 00000000000..9af5d7aa470
--- /dev/null
+++ b/src/glsl/tests/condition-03.glsl
@@ -0,0 +1,8 @@
+/* PASS */
+
+uniform bool a;
+
+void main()
+{
+ gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec4(0.0, 1.0, 0.0, 1.0);
+}
diff --git a/src/glsl/tests/condition-04.glsl b/src/glsl/tests/condition-04.glsl
new file mode 100644
index 00000000000..f440b7e9955
--- /dev/null
+++ b/src/glsl/tests/condition-04.glsl
@@ -0,0 +1,8 @@
+/* FAIL - type of second two operands must match */
+
+uniform bool a;
+
+void main()
+{
+ gl_Position = (a) ? vec4(1.0, 0.0, 0.0, 1.0) : vec3(0.0, 1.0, 0.0);
+}
diff --git a/src/glsl/tests/condition-05.glsl b/src/glsl/tests/condition-05.glsl
new file mode 100644
index 00000000000..3dff18f519d
--- /dev/null
+++ b/src/glsl/tests/condition-05.glsl
@@ -0,0 +1,13 @@
+#version 120
+/* PASS */
+
+uniform bool a;
+uniform int b;
+
+void main()
+{
+ float x;
+
+ x = (a) ? 2.0 : b;
+ gl_Position = vec4(x);
+}
diff --git a/src/glsl/tests/constructor-01.glsl b/src/glsl/tests/constructor-01.glsl
new file mode 100644
index 00000000000..fdfaf898663
--- /dev/null
+++ b/src/glsl/tests/constructor-01.glsl
@@ -0,0 +1,6 @@
+/* PASS */
+
+void main()
+{
+ gl_Position = vec4(1.0, 1.0, 1.0, 0.0);;
+}
diff --git a/src/glsl/tests/constructor-02.glsl b/src/glsl/tests/constructor-02.glsl
new file mode 100644
index 00000000000..47acbe9db14
--- /dev/null
+++ b/src/glsl/tests/constructor-02.glsl
@@ -0,0 +1,7 @@
+/* FAIL - cannot construct samplers */
+void main()
+{
+ int i;
+
+ i = sampler2D(0);
+}
diff --git a/src/glsl/tests/constructor-03.glsl b/src/glsl/tests/constructor-03.glsl
new file mode 100644
index 00000000000..07ec225633a
--- /dev/null
+++ b/src/glsl/tests/constructor-03.glsl
@@ -0,0 +1,12 @@
+/* FAIL - cannot construct a matrix from a matrix in GLSL 1.10 */
+
+uniform mat2 a;
+
+void main()
+{
+ mat2 b;
+
+ b = mat2(a);
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/constructor-04.glsl b/src/glsl/tests/constructor-04.glsl
new file mode 100644
index 00000000000..19d5e011dea
--- /dev/null
+++ b/src/glsl/tests/constructor-04.glsl
@@ -0,0 +1,14 @@
+#version 120
+/* FAIL - matrix must be only parameter to matrix constructor */
+
+uniform mat2 a;
+uniform float x;
+
+void main()
+{
+ mat2 b;
+
+ b = mat2(a, x);
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/constructor-05.glsl b/src/glsl/tests/constructor-05.glsl
new file mode 100644
index 00000000000..9c74f75a404
--- /dev/null
+++ b/src/glsl/tests/constructor-05.glsl
@@ -0,0 +1,13 @@
+/* FAIL - too few components supplied to constructor */
+
+uniform vec2 a;
+uniform float x;
+
+void main()
+{
+ mat2 b;
+
+ b = mat2(a, x);
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/constructor-06.glsl b/src/glsl/tests/constructor-06.glsl
new file mode 100644
index 00000000000..d77a5f9e892
--- /dev/null
+++ b/src/glsl/tests/constructor-06.glsl
@@ -0,0 +1,13 @@
+#version 120
+/* PASS */
+
+uniform mat2 a;
+
+void main()
+{
+ mat2 b;
+
+ b = mat2(a);
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/constructor-07.glsl b/src/glsl/tests/constructor-07.glsl
new file mode 100644
index 00000000000..92322506ed1
--- /dev/null
+++ b/src/glsl/tests/constructor-07.glsl
@@ -0,0 +1,13 @@
+/* PASS */
+
+uniform ivec2 a;
+uniform ivec2 b;
+
+void main()
+{
+ mat2 c;
+
+ c = mat2(a, b);
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/constructor-08.glsl b/src/glsl/tests/constructor-08.glsl
new file mode 100644
index 00000000000..27153f0cda1
--- /dev/null
+++ b/src/glsl/tests/constructor-08.glsl
@@ -0,0 +1,13 @@
+/* PASS */
+
+uniform float a;
+uniform float b;
+
+void main()
+{
+ ivec2 c;
+
+ c = ivec2(a, b);
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/constructor-09.glsl b/src/glsl/tests/constructor-09.glsl
new file mode 100644
index 00000000000..1985699b305
--- /dev/null
+++ b/src/glsl/tests/constructor-09.glsl
@@ -0,0 +1,26 @@
+/* PASS */
+
+uniform int a;
+uniform float b;
+uniform bool c;
+
+void main()
+{
+ float x;
+ int y;
+ bool z;
+
+ x = float(a);
+ x = float(b);
+ x = float(c);
+
+ y = int(a);
+ y = int(b);
+ y = int(c);
+
+ z = bool(a);
+ z = bool(b);
+ z = bool(c);
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/function-01.glsl b/src/glsl/tests/function-01.glsl
new file mode 100644
index 00000000000..0eaa2397ab6
--- /dev/null
+++ b/src/glsl/tests/function-01.glsl
@@ -0,0 +1,16 @@
+/* FAIL - no function named 'foo' exists */
+
+vec4 bar(float x, float y, float z, float w)
+{
+ vec4 v;
+ v.x = x;
+ v.y = y;
+ v.z = z;
+ v.w = w;
+ return v;
+}
+
+void main()
+{
+ gl_Position = foo(1.0, 1.0, 1.0, 0.0);
+}
diff --git a/src/glsl/tests/function-02.glsl b/src/glsl/tests/function-02.glsl
new file mode 100644
index 00000000000..941fcc1ef7b
--- /dev/null
+++ b/src/glsl/tests/function-02.glsl
@@ -0,0 +1,16 @@
+/* FAIL - no version of 'foo' matches the call to 'foo' */
+
+vec4 foo(float x, float y, float z, float w)
+{
+ vec4 v;
+ v.x = x;
+ v.y = y;
+ v.z = z;
+ v.w = w;
+ return v;
+}
+
+void main()
+{
+ gl_Position = foo(1.0, 1.0, 1.0);
+}
diff --git a/src/glsl/tests/function-03.glsl b/src/glsl/tests/function-03.glsl
new file mode 100644
index 00000000000..b0da42f8e96
--- /dev/null
+++ b/src/glsl/tests/function-03.glsl
@@ -0,0 +1,16 @@
+/* PASS */
+
+vec4 foo(in float x, in float y, float z, float w)
+{
+ vec4 v;
+ v.x = x;
+ v.y = y;
+ v.z = z;
+ v.w = w;
+ return v;
+}
+
+void main()
+{
+ gl_Position = foo(1.0, 1.0, 1.0, 0.0);
+}
diff --git a/src/glsl/tests/function-04.glsl b/src/glsl/tests/function-04.glsl
new file mode 100644
index 00000000000..dfc0d2b7a6c
--- /dev/null
+++ b/src/glsl/tests/function-04.glsl
@@ -0,0 +1,15 @@
+/* FAIL - type mismatch in assignment */
+
+vec3 foo(float x, float y, float z)
+{
+ vec3 v;
+ v.x = x;
+ v.y = y;
+ v.z = z;
+ return v;
+}
+
+void main()
+{
+ gl_Position = foo(1.0, 1.0, 1.0);
+}
diff --git a/src/glsl/tests/function-05.glsl b/src/glsl/tests/function-05.glsl
new file mode 100644
index 00000000000..43365bf6062
--- /dev/null
+++ b/src/glsl/tests/function-05.glsl
@@ -0,0 +1,26 @@
+/* PASS */
+
+vec4 foo(in float x, in float y, float z, float w)
+{
+ vec4 v;
+ v.x = x;
+ v.y = y;
+ v.z = z;
+ v.w = w;
+ return v;
+}
+
+vec4 foo(in float x)
+{
+ vec4 v;
+ v.x = x;
+ v.y = x;
+ v.z = x;
+ v.w = x;
+}
+
+void main()
+{
+ gl_Position = foo(1.0, 1.0, 1.0, 0.0);
+ gl_Position = foo(2.0);
+}
diff --git a/src/glsl/tests/if-01.glsl b/src/glsl/tests/if-01.glsl
new file mode 100644
index 00000000000..ca9abd54f75
--- /dev/null
+++ b/src/glsl/tests/if-01.glsl
@@ -0,0 +1,11 @@
+/* FAIL - if-statement condition is not bool scalar */
+
+uniform bvec4 a;
+
+void main()
+{
+ if (a)
+ gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
+ else
+ gl_Position = vec4(0.0, 1.0, 0.0, 1.0);
+}
diff --git a/src/glsl/tests/if-02.glsl b/src/glsl/tests/if-02.glsl
new file mode 100644
index 00000000000..7adccea0432
--- /dev/null
+++ b/src/glsl/tests/if-02.glsl
@@ -0,0 +1,11 @@
+/* FAIL - if-statement condition is not bool scalar */
+
+uniform float a;
+
+void main()
+{
+ if (a)
+ gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
+ else
+ gl_Position = vec4(0.0, 1.0, 0.0, 1.0);
+}
diff --git a/src/glsl/tests/if-03.glsl b/src/glsl/tests/if-03.glsl
new file mode 100644
index 00000000000..179618c716e
--- /dev/null
+++ b/src/glsl/tests/if-03.glsl
@@ -0,0 +1,11 @@
+/* PASS */
+
+uniform bool a;
+
+void main()
+{
+ if (a)
+ gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
+ else
+ gl_Position = vec4(0.0, 1.0, 0.0, 1.0);
+}
diff --git a/src/glsl/tests/if-04.glsl b/src/glsl/tests/if-04.glsl
new file mode 100644
index 00000000000..7b711fb7edf
--- /dev/null
+++ b/src/glsl/tests/if-04.glsl
@@ -0,0 +1,11 @@
+/* PASS */
+
+uniform bvec4 a;
+
+void main()
+{
+ if (a.x)
+ gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
+ else
+ gl_Position = vec4(0.0, 1.0, 0.0, 1.0);
+}
diff --git a/src/glsl/tests/matrix-01.glsl b/src/glsl/tests/matrix-01.glsl
new file mode 100644
index 00000000000..f46416c8f67
--- /dev/null
+++ b/src/glsl/tests/matrix-01.glsl
@@ -0,0 +1,6 @@
+/* FAIL - non-square matrices are not available in GLSL 1.10 */
+
+void main()
+{
+ mat2x3 m;
+}
diff --git a/src/glsl/tests/matrix-02.glsl b/src/glsl/tests/matrix-02.glsl
new file mode 100644
index 00000000000..0630722b795
--- /dev/null
+++ b/src/glsl/tests/matrix-02.glsl
@@ -0,0 +1,6 @@
+/* FAIL - non-square matrices are not available in GLSL 1.10 */
+
+void main()
+{
+ mat2x4 m;
+}
diff --git a/src/glsl/tests/matrix-03.glsl b/src/glsl/tests/matrix-03.glsl
new file mode 100644
index 00000000000..925dc806258
--- /dev/null
+++ b/src/glsl/tests/matrix-03.glsl
@@ -0,0 +1,6 @@
+/* FAIL - non-square matrices are not available in GLSL 1.10 */
+
+void main()
+{
+ mat3x2 m;
+}
diff --git a/src/glsl/tests/matrix-04.glsl b/src/glsl/tests/matrix-04.glsl
new file mode 100644
index 00000000000..5275619b319
--- /dev/null
+++ b/src/glsl/tests/matrix-04.glsl
@@ -0,0 +1,6 @@
+/* FAIL - non-square matrices are not available in GLSL 1.10 */
+
+void main()
+{
+ mat3x4 m;
+}
diff --git a/src/glsl/tests/matrix-05.glsl b/src/glsl/tests/matrix-05.glsl
new file mode 100644
index 00000000000..74e1fd25148
--- /dev/null
+++ b/src/glsl/tests/matrix-05.glsl
@@ -0,0 +1,6 @@
+/* FAIL - non-square matrices are not available in GLSL 1.10 */
+
+void main()
+{
+ mat4x2 m;
+}
diff --git a/src/glsl/tests/matrix-06.glsl b/src/glsl/tests/matrix-06.glsl
new file mode 100644
index 00000000000..0a512b85234
--- /dev/null
+++ b/src/glsl/tests/matrix-06.glsl
@@ -0,0 +1,6 @@
+/* FAIL - non-square matrices are not available in GLSL 1.10 */
+
+void main()
+{
+ mat4x3 m;
+}
diff --git a/src/glsl/tests/matrix-07.glsl b/src/glsl/tests/matrix-07.glsl
new file mode 100644
index 00000000000..0b59aa69d50
--- /dev/null
+++ b/src/glsl/tests/matrix-07.glsl
@@ -0,0 +1,27 @@
+/* PASS */
+
+uniform mat2 a;
+uniform mat2 b;
+uniform mat2 c;
+uniform mat2 d;
+uniform mat3 e;
+uniform mat3 f;
+uniform mat3 g;
+uniform mat3 h;
+uniform mat4 i;
+uniform mat4 j;
+uniform mat4 k;
+uniform mat4 l;
+
+void main()
+{
+ mat2 x;
+ mat3 y;
+ mat4 z;
+
+ x = a * b + c / d;
+ y = e * f + g / h;
+ z = i * j + k / l;
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/matrix-08.glsl b/src/glsl/tests/matrix-08.glsl
new file mode 100644
index 00000000000..38138d22de4
--- /dev/null
+++ b/src/glsl/tests/matrix-08.glsl
@@ -0,0 +1,19 @@
+#version 120
+/* PASS */
+
+uniform mat2x3 a;
+uniform mat3x2 b;
+uniform mat3x3 c;
+uniform mat3x3 d;
+
+void main()
+{
+ mat3x3 x;
+
+ /* Multiplying a 2 column, 3 row matrix with a 3 column, 2 row matrix
+ * results in a 3 column, 3 row matrix.
+ */
+ x = (a * b) + c / d;
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/matrix-09.glsl b/src/glsl/tests/matrix-09.glsl
new file mode 100644
index 00000000000..18afbcacea7
--- /dev/null
+++ b/src/glsl/tests/matrix-09.glsl
@@ -0,0 +1,11 @@
+/* FAIL - matrix-to-matrix constructors are not available in GLSL 1.10 */
+
+uniform mat3 a;
+
+void main()
+{
+ mat2 m;
+
+ m = mat2(a);
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/matrix-10.glsl b/src/glsl/tests/matrix-10.glsl
new file mode 100644
index 00000000000..20b55180cbb
--- /dev/null
+++ b/src/glsl/tests/matrix-10.glsl
@@ -0,0 +1,12 @@
+#version 120
+/* PASS */
+
+uniform mat3 a;
+
+void main()
+{
+ mat2 m;
+
+ m = mat2(a);
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/parameters-01.glsl b/src/glsl/tests/parameters-01.glsl
new file mode 100644
index 00000000000..b485106e9d7
--- /dev/null
+++ b/src/glsl/tests/parameters-01.glsl
@@ -0,0 +1,11 @@
+/* FAIL: redefinition of a() */
+
+void a()
+{
+ ;
+}
+
+void a()
+{
+ ;
+}
diff --git a/src/glsl/tests/parameters-02.glsl b/src/glsl/tests/parameters-02.glsl
new file mode 100644
index 00000000000..7ff5f59ab79
--- /dev/null
+++ b/src/glsl/tests/parameters-02.glsl
@@ -0,0 +1,11 @@
+/* PASS */
+
+void a()
+{
+ ;
+}
+
+void a(float x)
+{
+ ;
+}
diff --git a/src/glsl/tests/parameters-03.glsl b/src/glsl/tests/parameters-03.glsl
new file mode 100644
index 00000000000..7ec30f80cc6
--- /dev/null
+++ b/src/glsl/tests/parameters-03.glsl
@@ -0,0 +1,9 @@
+/* FAIL - x is redeclared in the function body at the same scope as the
+ * parameter
+ */
+void a(float x, float y)
+{
+ float x;
+
+ x = y;
+}
diff --git a/src/glsl/tests/qualifier-01.glsl b/src/glsl/tests/qualifier-01.glsl
new file mode 100644
index 00000000000..54ec3572a24
--- /dev/null
+++ b/src/glsl/tests/qualifier-01.glsl
@@ -0,0 +1,3 @@
+#version 130
+/* FAIL - inout only allowed in parameter list */
+inout vec4 foo;
diff --git a/src/glsl/tests/qualifier-02.glsl b/src/glsl/tests/qualifier-02.glsl
new file mode 100644
index 00000000000..b635d52aa2a
--- /dev/null
+++ b/src/glsl/tests/qualifier-02.glsl
@@ -0,0 +1,2 @@
+/* FAIL - in only allowed in parameter list in GLSL 1.10 */
+in foo;
diff --git a/src/glsl/tests/qualifier-03.glsl b/src/glsl/tests/qualifier-03.glsl
new file mode 100644
index 00000000000..7e448034a7c
--- /dev/null
+++ b/src/glsl/tests/qualifier-03.glsl
@@ -0,0 +1,2 @@
+/* FAIL - out only allowed in parameter list in GLSL 1.10 */
+out vec4 foo;
diff --git a/src/glsl/tests/qualifier-04.glsl b/src/glsl/tests/qualifier-04.glsl
new file mode 100644
index 00000000000..d03cafc1db2
--- /dev/null
+++ b/src/glsl/tests/qualifier-04.glsl
@@ -0,0 +1,3 @@
+#version 130
+/* PASS */
+in vec4 foo;
diff --git a/src/glsl/tests/qualifier-05.glsl b/src/glsl/tests/qualifier-05.glsl
new file mode 100644
index 00000000000..15281f33840
--- /dev/null
+++ b/src/glsl/tests/qualifier-05.glsl
@@ -0,0 +1,3 @@
+#version 130
+/* PASS */
+out vec4 foo;
diff --git a/src/glsl/tests/qualifier-06.glsl b/src/glsl/tests/qualifier-06.glsl
new file mode 100644
index 00000000000..1907a087c8e
--- /dev/null
+++ b/src/glsl/tests/qualifier-06.glsl
@@ -0,0 +1,7 @@
+/* FAIL - in only allowed in parameter list in GLSL 1.10 */
+void main()
+{
+ in vec4 foo;
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/qualifier-07.glsl b/src/glsl/tests/qualifier-07.glsl
new file mode 100644
index 00000000000..12568a57dbc
--- /dev/null
+++ b/src/glsl/tests/qualifier-07.glsl
@@ -0,0 +1,7 @@
+/* FAIL - out only allowed in parameter list in GLSL 1.10 */
+void main()
+{
+ out vec4 foo;
+
+ gl_Position = gl_Vertex;
+}
diff --git a/src/glsl/tests/swiz-01.glsl b/src/glsl/tests/swiz-01.glsl
new file mode 100644
index 00000000000..3268fa178c1
--- /dev/null
+++ b/src/glsl/tests/swiz-01.glsl
@@ -0,0 +1,11 @@
+/* PASS */
+#version 120
+
+void main()
+{
+ float a;
+ vec4 b;
+
+ b.x = 6.0;
+ a = b.x;
+}
diff --git a/src/glsl/tests/swiz-02.glsl b/src/glsl/tests/swiz-02.glsl
new file mode 100644
index 00000000000..e3f043c47bd
--- /dev/null
+++ b/src/glsl/tests/swiz-02.glsl
@@ -0,0 +1,11 @@
+/* FAIL: assignment of a vec2 to a float */
+#version 120
+
+void main()
+{
+ float a;
+ vec4 b;
+
+ b.x = 6.0;
+ a = b.xy;
+}
diff --git a/src/glsl/tests/void-01.glsl b/src/glsl/tests/void-01.glsl
new file mode 100644
index 00000000000..5719edc0b6c
--- /dev/null
+++ b/src/glsl/tests/void-01.glsl
@@ -0,0 +1,2 @@
+/* FAIL - cannot declare a variable as having type `void' */
+void foo;