1// A continue inside a switch (where permitted) prevents fallthrough to the next case block, just 2// like a break statement would. 3 4// Make sure that we properly dead-strip code following `continue` in a switch. 5// This is particularly relevant because our inliner replaces return statements with continue. 6 7uniform half4 colorGreen, colorRed; 8 9half4 main(float2 coords) { 10 // A looping construct is required for continue. 11 float result = 0; 12 for (int x=0; x<=1; x++) { 13 @switch (2) { 14 case 1: result = abs(1); continue; 15 case 2: result = abs(2); continue; 16 case 3: result = abs(3); continue; 17 case 4: result = abs(4); continue; 18 } 19 } 20 21 return result == 2 ? colorGreen : colorRed; 22} 23