1// Should return 5 2float return_loop() { 3 for (float i = 0; i < 10; ++i) { 4 if (i == 5) { return i; } 5 } 6 return 0; 7} 8 9// Should return 35 10float continue_loop() { 11 float sum = 0; 12 for (float i = 0; i < 10; ++i) { 13 if (i < 5) { continue; } 14 sum += i; 15 } 16 return sum; 17} 18 19// Should return 15 20float break_loop() { 21 float sum = 0; 22 for (float i = 0; i < 10; ++i) { 23 if (i > 5) { break; } 24 sum += i; 25 } 26 return sum; 27} 28 29// Should return ~1.725 30float float_loop() { 31 float sum = 0; 32 for (float i = 0.123; i < 0.6; i += 0.111) { 33 sum += i; 34 } 35 return sum; 36} 37 38half4 main(float2 xy) { 39 return half4(return_loop(), continue_loop(), break_loop(), float_loop()); 40} 41