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 half unknownInput; 11}; 12struct Inputs { 13}; 14struct Outputs { 15 half4 sk_FragColor [[color(0)]]; 16}; 17bool inside_while_loop_b(Uniforms _uniforms) { 18 while (_uniforms.unknownInput == 123.0h) { 19 return false; 20 } 21 return true; 22} 23bool inside_infinite_do_loop_b() { 24 do { 25 return true; 26 } while (true); 27} 28bool inside_infinite_while_loop_b() { 29 while (true) { 30 return true; 31 } 32} 33bool after_do_loop_b() { 34 do { 35 break; 36 } while (true); 37 return true; 38} 39bool after_while_loop_b() { 40 while (true) { 41 break; 42 } 43 return true; 44} 45bool switch_with_all_returns_b(Uniforms _uniforms) { 46 switch (int(_uniforms.unknownInput)) { 47 case 1: 48 return true; 49 case 2: 50 return false; 51 default: 52 return false; 53 } 54} 55bool switch_fallthrough_b(Uniforms _uniforms) { 56 switch (int(_uniforms.unknownInput)) { 57 case 1: 58 return true; 59 case 2: 60 default: 61 return false; 62 } 63} 64bool switch_fallthrough_twice_b(Uniforms _uniforms) { 65 switch (int(_uniforms.unknownInput)) { 66 case 1: 67 case 2: 68 default: 69 return true; 70 } 71} 72bool switch_with_break_in_loop_b(Uniforms _uniforms) { 73 switch (int(_uniforms.unknownInput)) { 74 case 1: 75 for (int x = 0;x <= 10; ++x) { 76 break; 77 } 78 default: 79 return true; 80 } 81} 82bool switch_with_continue_in_loop_b(Uniforms _uniforms) { 83 switch (int(_uniforms.unknownInput)) { 84 case 1: 85 for (int x = 0;x <= 10; ++x) { 86 continue; 87 } 88 default: 89 return true; 90 } 91} 92bool switch_with_if_that_returns_b(Uniforms _uniforms) { 93 switch (int(_uniforms.unknownInput)) { 94 case 1: 95 if (_uniforms.unknownInput == 123.0h) return false; else return true; 96 default: 97 return true; 98 } 99} 100bool switch_with_one_sided_if_then_fallthrough_b(Uniforms _uniforms) { 101 switch (int(_uniforms.unknownInput)) { 102 case 1: 103 if (_uniforms.unknownInput == 123.0h) return false; 104 default: 105 return true; 106 } 107} 108fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) { 109 Outputs _out; 110 (void)_out; 111 _out.sk_FragColor = ((((((((((inside_while_loop_b(_uniforms) && inside_infinite_do_loop_b()) && inside_infinite_while_loop_b()) && after_do_loop_b()) && after_while_loop_b()) && switch_with_all_returns_b(_uniforms)) && switch_fallthrough_b(_uniforms)) && switch_fallthrough_twice_b(_uniforms)) && switch_with_break_in_loop_b(_uniforms)) && switch_with_continue_in_loop_b(_uniforms)) && switch_with_if_that_returns_b(_uniforms)) && switch_with_one_sided_if_then_fallthrough_b(_uniforms) ? _uniforms.colorGreen : _uniforms.colorRed; 112 return _out; 113} 114