]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/invalid_expressions.glsl
Additional rules for bit shift operators
[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         ivec3 iv;
16         i<<iv;
17 }
18
19 /* Expected error:
20 <test>:4: Initializing a variable of type 'int' with an expression of incompatible type 'float'
21 <test>:5: Initializing a variable of type 'bool' with an expression of incompatible type 'int'
22 <test>:6: Assignment to variable of type 'int' from expression of incompatible type 'bool'
23 <test>:7: No matching operator '*' found for 'int' and 'bool'
24 <test>:8: Initializing a variable of type 'float' with an expression of incompatible type 'bool'
25 <test>:9: No matching operator '+' found for 'float' and 'bool'
26 <test>:10: No matching operator '/' found for 'int' and 'float'
27 <test>:13: No matching operator '*' found for 'mat3x2' and 'mat3x2'
28 <test>:14: No matching operator '*' found for 'vec3' and 'mat3x2'
29 <test>:16: No matching operator '<<' found for 'int' and 'ivec3'
30 */