1*c8dee2aaSAndroid Build Coastguard Workeruniform half4 colorGreen, colorRed; 2*c8dee2aaSAndroid Build Coastguard Workerint gAccessCount = 0; 3*c8dee2aaSAndroid Build Coastguard Worker 4*c8dee2aaSAndroid Build Coastguard Workernoinline int Z() { 5*c8dee2aaSAndroid Build Coastguard Worker ++gAccessCount; 6*c8dee2aaSAndroid Build Coastguard Worker return 0; 7*c8dee2aaSAndroid Build Coastguard Worker} 8*c8dee2aaSAndroid Build Coastguard Worker 9*c8dee2aaSAndroid Build Coastguard Workerhalf4 main(float2) { 10*c8dee2aaSAndroid Build Coastguard Worker float4 array[1]; 11*c8dee2aaSAndroid Build Coastguard Worker 12*c8dee2aaSAndroid Build Coastguard Worker // Test swizzled-lvalue assignment on an array element with a side-effecting index expression. 13*c8dee2aaSAndroid Build Coastguard Worker array[Z()] = float4(colorGreen) * 0.5; // 0, 0.5, 0, 0.5 14*c8dee2aaSAndroid Build Coastguard Worker array[Z()].a = 2.0; // 0, 0.5, 0, 2 15*c8dee2aaSAndroid Build Coastguard Worker array[Z()].g /= 0.25; // 0, 2, 0, 2 16*c8dee2aaSAndroid Build Coastguard Worker array[Z()].gba *= float3x3(0.5); // 0, 1, 0, 1 17*c8dee2aaSAndroid Build Coastguard Worker array[Z()].bgar += float4(0.25, 0.0, 0.0, 0.75); // 0.75, 1, 0.25, 1 18*c8dee2aaSAndroid Build Coastguard Worker array[Z()].r += array[Z()].a <= 1.0 ? array[Z()].b : float(Z()); // 1, 1, 0.25, 1 19*c8dee2aaSAndroid Build Coastguard Worker 20*c8dee2aaSAndroid Build Coastguard Worker return (gAccessCount == 8 && array[0] == float4(1, 1, 0.25, 1)) ? colorGreen 21*c8dee2aaSAndroid Build Coastguard Worker : colorRed; 22*c8dee2aaSAndroid Build Coastguard Worker} 23