1uniform half4 colorGreen, colorRed; 2 3bool test_float() { 4 const float one = 1; 5 float two = 2; 6 7 float4 result; 8 result.r = (half4(-1) == -half4(-half2(-1), half2(1))) ? 1 : 0; 9 result.g = (half4(1) != -half4(1)) ? 1 : 0; 10 result.b = (-half4(two) == half4(-two, half3(-two))) ? 1 : 0; 11 result.a = (-half2(-one, one + one) == -half2(one - two, two)) ? 1 : 0; 12 13 return bool(result.r * result.g * result.b * -(-result.a)); 14} 15 16bool test_int() { 17 int one = 1; 18 const int two = 2; 19 20 int4 result; 21 result.r = (int4(-1) == -int4(-int2(-1), int2(1))) ? 1 : 0; 22 result.g = (int4(1) != -int4(1)) ? 1 : 0; 23 result.b = (-int4(two) == int4(-two, int3(-two))) ? 1 : 0; 24 result.a = (-int2(-one, one + one) == -int2(one - two, two)) ? 1 : 0; 25 26 return bool(-(-result.r) * result.g * result.b * result.a); 27} 28 29half4 main(float2 coords) { 30 return test_float() && test_int() ? colorGreen : colorRed; 31} 32