blob: 0f3432a3af1f2e35747327b4285115c93a045aa1 [file] [log] [blame]
out vec4 sk_FragColor;
uniform vec4 colorGreen;
uniform vec4 colorRed;
uniform mat2 testMatrix2x2;
vec4 main() {
bool ok = true;
int i = 5;
++i;
ok = ok && i == 6;
ok = ok && ++i == 7;
ok = ok && --i == 6;
--i;
ok = ok && i == 5;
float f = 0.5;
++f;
ok = ok && f == 1.5;
ok = ok && ++f == 2.5;
ok = ok && --f == 1.5;
--f;
ok = ok && f == 0.5;
vec2 f2 = vec2(0.5);
++f2.x;
ok = ok && f2.x == 1.5;
ok = ok && ++f2.x == 2.5;
ok = ok && --f2.x == 1.5;
--f2.x;
ok = ok && f2.x == 0.5;
++f2;
ok = ok && f2 == vec2(1.5);
ok = ok && ++f2 == vec2(2.5);
ok = ok && --f2 == vec2(1.5);
--f2;
ok = ok && f2 == vec2(0.5);
ivec4 i4 = ivec4(7, 8, 9, 10);
++i4;
ok = ok && i4 == ivec4(8, 9, 10, 11);
ok = ok && ++i4 == ivec4(9, 10, 11, 12);
ok = ok && --i4 == ivec4(8, 9, 10, 11);
--i4;
ok = ok && i4 == ivec4(7, 8, 9, 10);
mat3 m3x3 = mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0);
++m3x3;
ok = ok && m3x3 == mat3(2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0);
ok = ok && ++m3x3 == mat3(3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0);
ok = ok && --m3x3 == mat3(2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0);
--m3x3;
ok = ok && m3x3 == mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0);
ok = ok && colorGreen.x != 1.0;
ok = ok && -1.0 == -colorGreen.y;
ok = ok && vec4(0.0, -1.0, 0.0, -1.0) == -colorGreen;
ok = ok && mat2(-1.0, -2.0, -3.0, -4.0) == -testMatrix2x2;
ivec2 iv = ivec2(i, -i);
ok = ok && -i == -5;
ok = ok && -iv == ivec2(-5, 5);
return ok ? colorGreen : colorRed;
}