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