]> git.tdb.fi Git - libs/gl.git/blobdiff - tests/glsl/invalid_expressions.glsl
Assign a result type to all expressions
[libs/gl.git] / tests / glsl / invalid_expressions.glsl
diff --git a/tests/glsl/invalid_expressions.glsl b/tests/glsl/invalid_expressions.glsl
new file mode 100644 (file)
index 0000000..cf27c9a
--- /dev/null
@@ -0,0 +1,23 @@
+#pragma MSP stage(vertex)
+void main()
+{
+       int i = 1.0;
+       bool b = 0;
+       i = b;
+       float f = b;
+       i+b;
+       mat3x2 m;
+       vec3 v;
+       m*m;
+       v*m;
+}
+
+/* Expected error:
+<test>:4: Initializing a variable of type 'int' with an expression of type 'float'
+<test>:5: Initializing a variable of type 'bool' with an expression of type 'int'
+<test>:6: Assignment to variable of type 'int' from expression of type 'bool'
+<test>:7: Initializing a variable of type 'float' with an expression of type 'bool'
+<test>:8: No matching operator '+' found for 'int' and 'bool'
+<test>:11: No matching operator '*' found for 'mat3x2' and 'mat3x2'
+<test>:12: No matching operator '*' found for 'vec3' and 'mat3x2'
+*/