]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/invalid_expressions.glsl
996b0d355fecc09b2ce14d51f134672e12fa035f
[libs/gl.git] / tests / glsl / invalid_expressions.glsl
1 #pragma MSP stage(vertex)
2 void main()
3 {
4         int i = 1.0;
5         bool b = 0;
6         i = b;
7         i *= b;
8         float f = b;
9         f+b;
10         i /= f;
11         mat3x2 m;
12         vec3 v;
13         m*m;
14         v*m;
15 }
16
17 /* Expected error:
18 <test>:4: Initializing a variable of type 'int' with an expression of incompatible type 'float'
19 <test>:5: Initializing a variable of type 'bool' with an expression of incompatible type 'int'
20 <test>:6: Assignment to variable of type 'int' from expression of incompatible type 'bool'
21 <test>:7: No matching operator '*' found for 'int' and 'bool'
22 <test>:8: Initializing a variable of type 'float' with an expression of incompatible type 'bool'
23 <test>:9: No matching operator '+' found for 'float' and 'bool'
24 <test>:10: No matching operator '/' found for 'int' and 'float'
25 <test>:13: No matching operator '*' found for 'mat3x2' and 'mat3x2'
26 <test>:14: No matching operator '*' found for 'vec3' and 'mat3x2'
27 */