blob: 1808086a4659080dc875b57d6a95d1e90619d000 [file] [log] [blame]
John Kessenich0e7674a2015-06-26 12:24:28 -06001#version 310 es
John Kessenich39374da2015-05-15 21:32:46 +00002precision mediump float;
John Kessenich6c292d32016-02-15 20:58:50 -07003flat in int c, d;
John Kessenich39374da2015-05-15 21:32:46 +00004in float x;
5out float color;
John Kessenich6c292d32016-02-15 20:58:50 -07006in vec4 v;
John Kessenich39374da2015-05-15 21:32:46 +00007
8vec4 foo1(vec4 v1, vec4 v2, int i1)
9{
10 switch (i1)
11 {
12 case 0:
13 return v1;
14 case 2:
15 case 1:
16 return v2;
17 case 3:
18 return v1 * v2;
19 }
20
21 return vec4(0.0);
22}
23
24vec4 foo2(vec4 v1, vec4 v2, int i1)
25{
26 switch (i1)
27 {
28 case 0:
29 return v1;
30 case 2:
31 return vec4(1.0);
32 case 1:
33 return v2;
34 case 3:
35 return v1 * v2;
36 }
37
38 return vec4(0.0);
39}
40
41void main()
42{
43 float f;
44 int a[2];
45 int local = c;
46
47 switch(++local)
48 {
49 }
50
51 switch (c) {
52 case 1:
53 f = sin(x);
54 break;
55 case 2:
56 f = cos(x);
57 break;
58 default:
59 f = tan(x);
60 }
61
62 switch (c) {
63 case 1:
64 f += sin(x);
65 case 2:
66 f += cos(x);
67 break;
68 default:
69 f += tan(x);
70 }
71
72 switch (c) {
73 case 1:
74 f += sin(x);
75 break;
76 case 2:
77 f += cos(x);
78 break;
79 }
80
81 switch (c) {
82 case 1:
83 f += sin(x);
84 break;
85 case 2:
86 switch (d) {
87 case 1:
88 f += x * x * x;
89 break;
90 case 2:
91 f += x * x;
92 break;
93 }
94 break;
95 default:
96 f += tan(x);
97 }
98
99 for (int i = 0; i < 10; ++i) {
100 switch (c) {
101 case 1:
102 f += sin(x);
103 for (int j = 20; j < 30; ++j) {
104 ++f;
105 if (f < 100.2)
106 break;
107 }
108 break;
109 case 2:
110 f += cos(x);
111 break;
112 break;
113 default:
114 f += tan(x);
115 }
116
117 if (f < 3.43)
118 break;
119 }
120
121 switch (c) {
122 case 1:
123 f += sin(x);
124 break;
125 case 2:
126 // test no statements at end
127 }
128
129 color = f + float(local);
130
131 color += foo1(v,v,c).y;
132 color += foo2(v,v,c).z;
John Kessenich8d64d442015-06-12 22:34:37 +0000133
134 switch (c) {
135 case 0: break;
136 default:
137 }
138
139 switch (c) {
140 default:
141 }
John Kessenich39374da2015-05-15 21:32:46 +0000142}