blob: dab5c65f97b3839d854be236d89f4dc0728d2461 [file] [log] [blame]
John Kessenich05761262013-04-12 03:57:02 +00001#version 300 es
John Kessenich1fde51d2013-07-01 17:56:24 +00002precision highp float;
John Kessenich05761262013-04-12 03:57:02 +00003uniform int c, d;
John Kessenich01fc0642013-06-24 21:22:03 +00004in highp float x;
John Kessenich05761262013-04-12 03:57:02 +00005
6void main()
7{
8 float f;
9 int a[2];
10
John Kesseniche369bfc2013-06-26 05:54:40 +000011 switch(f) { // ERROR
John Kessenich05761262013-04-12 03:57:02 +000012 }
13
John Kesseniche369bfc2013-06-26 05:54:40 +000014 switch(a) { // ERROR
John Kessenich05761262013-04-12 03:57:02 +000015 }
16
17 switch(c)
18 {
19 }
20
John Kesseniche369bfc2013-06-26 05:54:40 +000021 switch(c) // ERROR, not enough stuff after last label
John Kessenich05761262013-04-12 03:57:02 +000022 {
John Kesseniche369bfc2013-06-26 05:54:40 +000023 case 2:
John Kessenich05761262013-04-12 03:57:02 +000024 }
25
26 switch(c)
27 {
John Kesseniche369bfc2013-06-26 05:54:40 +000028 f = sin(x); // ERRROR
29 case 2:
John Kessenich05761262013-04-12 03:57:02 +000030 f = cos(x);
31 break;
32 }
33
34 switch (c) {
John Kesseniche369bfc2013-06-26 05:54:40 +000035 default:
36 break;
John Kessenich05761262013-04-12 03:57:02 +000037 case 1:
38 f = sin(x);
39 break;
40 case 2:
41 f = cos(x);
42 break;
John Kesseniche369bfc2013-06-26 05:54:40 +000043 default: // ERROR, 2nd default
John Kessenich05761262013-04-12 03:57:02 +000044 f = tan(x);
45 }
46
47 switch (c) {
48 case 1:
49 f = sin(x);
50 break;
51 case 2:
52 switch (d) {
53 case 1:
54 f = x * x * x;
55 break;
56 case 2:
57 f = x * x;
58 break;
59 }
60 break;
61 default:
62 f = tan(x);
John Kesseniche369bfc2013-06-26 05:54:40 +000063 case 1: // ERROR, 2nd 'case 1'
64 break;
65 case 3.8: // ERROR, non-int
66 break;
67 case c: // ERROR, non-constant
68 break;
John Kessenich05761262013-04-12 03:57:02 +000069 }
70
John Kesseniche369bfc2013-06-26 05:54:40 +000071 switch (c) { // a no-error normal switch
72 case 1:
73 f = sin(x);
74 break;
75 case 2:
76 switch (d) {
77 case 1:
78 f = x * x * x;
79 break;
80 case 2:
81 f = x * x;
82 break;
83 }
84 break;
85 default:
86 f = tan(x);
87 }
88
89 break; // ERROR
John Kessenich7fd9e112013-12-04 21:48:20 +000090
91 switch (c) {
92 case 1:
93 f = sin(x);
94 break;
95 case 2:
96 switch (d) {
97 case 1:
98 {
99 case 4: // ERROR
100 break;
101 }
102 f = x * x * x;
103 if (c < d) {
104 case 2: // ERROR
105 f = x * x;
106 }
107 if (d < c)
108 case 3: // ERROR
109 break;
110 }
111 break;
John Kessenich99b0ffd2013-12-31 00:13:26 +0000112 case 4:
John Kessenich7fd9e112013-12-04 21:48:20 +0000113 f = tan(x);
John Kessenich99b0ffd2013-12-31 00:13:26 +0000114 if (f < 0.0)
115 default: // ERROR
116 break;
John Kessenich7fd9e112013-12-04 21:48:20 +0000117 }
118
John Kessenich99b0ffd2013-12-31 00:13:26 +0000119 case 5: // ERROR
120 default: // ERROR
John Kessenich71e01cb2014-03-17 22:48:25 +0000121
122 switch (0) {
123 default:
124 int onlyInSwitch = 0;
125 }
126 onlyInSwitch; // ERROR
127
128 switch (0) {
129 default:
130 int x; // current "no statement" ERROR, but maybe this should count as a statement, or the semantic check removed
131 }
132
133 switch (c) {
134 case 1:
135 {
136 int nestedX;
137 break;
138 }
139 case 2:
140 nestedX; // ERROR
141 break;
142 case 3:
143 int linearZ;
144 break;
145 case 4:
146 int linearY = linearZ;
147 break;
148 case 5: // ERROR? that branch bypassed an initializer?
149 const int linearC = 4;
150 break;
151 case 6: // ERROR? that branch bypassed an initializer?
152 linearC;
153 }
John Kessenich05761262013-04-12 03:57:02 +0000154}