1 # Test proper behavior of (a << b) << c where b+c >= 32
6 [vertex shader passthrough]
11 uniform int a = 0xffffffff;
15 /* Section 5.9 (Expressions) of the GLSL 1.30 spec says:
17 * The result is undefined if the right operand is negative, or greater
18 * than or equal to the number of bits in the left expression's base
21 * Both 7 and 25 are less than the number of bits in the left expression's
22 * base type, but (7+25) is not. Check for compilers that try to do a
23 * clever optimization here.
25 * Compilers that use the SM5 rules of (x << y) == (x << (y & 31)) will
26 * treat this as a shift by zero. Produce purple for those, and red for
27 * any other kind of failure.
29 int x = (a << 7) << 25;
32 gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);
35 ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
41 probe all rgba 0.0 1.0 0.0 1.0