1#include <metal_stdlib> 2#include <simd/simd.h> 3#ifdef __clang__ 4#pragma clang diagnostic ignored "-Wall" 5#endif 6using namespace metal; 7struct Uniforms { 8 half4 colorGreen; 9 half4 colorRed; 10}; 11struct Inputs { 12}; 13struct Outputs { 14 half4 sk_FragColor [[color(0)]]; 15}; 16bool test_return_b() { 17 do { 18 return true; 19 } while (false); 20} 21bool test_break_b() { 22 do { 23 break; 24 } while (false); 25 return true; 26} 27bool test_continue_b() { 28 do { 29 continue; 30 } while (false); 31 return true; 32} 33bool test_if_return_b(Uniforms _uniforms) { 34 do { 35 if (_uniforms.colorGreen.y > 0.0h) { 36 return true; 37 } else { 38 break; 39 } 40 continue; 41 } while (false); 42 return false; 43} 44bool test_if_break_b(Uniforms _uniforms) { 45 do { 46 if (_uniforms.colorGreen.y > 0.0h) { 47 break; 48 } else { 49 continue; 50 } 51 } while (false); 52 return true; 53} 54bool test_else_b(Uniforms _uniforms) { 55 do { 56 if (_uniforms.colorGreen.y == 0.0h) { 57 return false; 58 } else { 59 return true; 60 } 61 } while (false); 62} 63bool test_loop_return_b() { 64 return true; 65} 66bool test_loop_break_b() { 67 for (int x = 0;x <= 1; ++x) { 68 break; 69 } 70 return true; 71} 72fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { 73 Outputs _out; 74 (void)_out; 75 _out.sk_FragColor = ((((((test_return_b() && test_break_b()) && test_continue_b()) && test_if_return_b(_uniforms)) && test_if_break_b(_uniforms)) && test_else_b(_uniforms)) && test_loop_return_b()) && test_loop_break_b() ? _uniforms.colorGreen : _uniforms.colorRed; 76 return _out; 77} 78