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