2013-04-12 03:57:02 +00:00
|
|
|
#version 300 es
|
2013-07-01 17:56:24 +00:00
|
|
|
precision highp float;
|
2013-04-12 03:57:02 +00:00
|
|
|
uniform int c, d;
|
2013-06-24 21:22:03 +00:00
|
|
|
in highp float x;
|
2013-04-12 03:57:02 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
float f;
|
|
|
|
int a[2];
|
|
|
|
|
2013-06-26 05:54:40 +00:00
|
|
|
switch(f) { // ERROR
|
2013-04-12 03:57:02 +00:00
|
|
|
}
|
|
|
|
|
2013-06-26 05:54:40 +00:00
|
|
|
switch(a) { // ERROR
|
2013-04-12 03:57:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
switch(c)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-05-01 16:48:18 +00:00
|
|
|
switch(c) // WARNING, not enough stuff after last label
|
2013-04-12 03:57:02 +00:00
|
|
|
{
|
2013-06-26 05:54:40 +00:00
|
|
|
case 2:
|
2013-04-12 03:57:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
switch(c)
|
|
|
|
{
|
2013-06-26 05:54:40 +00:00
|
|
|
f = sin(x); // ERRROR
|
|
|
|
case 2:
|
2013-04-12 03:57:02 +00:00
|
|
|
f = cos(x);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (c) {
|
2013-06-26 05:54:40 +00:00
|
|
|
default:
|
|
|
|
break;
|
2013-04-12 03:57:02 +00:00
|
|
|
case 1:
|
|
|
|
f = sin(x);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
f = cos(x);
|
|
|
|
break;
|
2013-06-26 05:54:40 +00:00
|
|
|
default: // ERROR, 2nd default
|
2013-04-12 03:57:02 +00:00
|
|
|
f = tan(x);
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (c) {
|
2013-06-26 05:54:40 +00:00
|
|
|
case 1:
|
|
|
|
f = sin(x);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
switch (d) {
|
|
|
|
case 1:
|
|
|
|
f = x * x * x;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
f = x * x;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
f = tan(x);
|
|
|
|
case 1: // ERROR, 2nd 'case 1'
|
|
|
|
break;
|
|
|
|
case 3.8: // ERROR, non-int
|
|
|
|
break;
|
|
|
|
case c: // ERROR, non-constant
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (c) { // a no-error normal switch
|
2013-04-12 03:57:02 +00:00
|
|
|
case 1:
|
|
|
|
f = sin(x);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
switch (d) {
|
|
|
|
case 1:
|
|
|
|
f = x * x * x;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
f = x * x;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
f = tan(x);
|
|
|
|
}
|
|
|
|
|
2013-06-26 05:54:40 +00:00
|
|
|
break; // ERROR
|
2013-12-04 21:48:20 +00:00
|
|
|
|
|
|
|
switch (c) {
|
|
|
|
case 1:
|
|
|
|
f = sin(x);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
switch (d) {
|
|
|
|
case 1:
|
|
|
|
{
|
|
|
|
case 4: // ERROR
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
f = x * x * x;
|
|
|
|
if (c < d) {
|
|
|
|
case 2: // ERROR
|
|
|
|
f = x * x;
|
|
|
|
}
|
|
|
|
if (d < c)
|
|
|
|
case 3: // ERROR
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2013-12-31 00:13:26 +00:00
|
|
|
case 4:
|
2013-12-04 21:48:20 +00:00
|
|
|
f = tan(x);
|
2013-12-31 00:13:26 +00:00
|
|
|
if (f < 0.0)
|
|
|
|
default: // ERROR
|
|
|
|
break;
|
2013-12-04 21:48:20 +00:00
|
|
|
}
|
|
|
|
|
2013-12-31 00:13:26 +00:00
|
|
|
case 5: // ERROR
|
|
|
|
default: // ERROR
|
2014-03-17 22:48:25 +00:00
|
|
|
|
|
|
|
switch (0) {
|
|
|
|
default:
|
|
|
|
int onlyInSwitch = 0;
|
|
|
|
}
|
|
|
|
onlyInSwitch; // ERROR
|
|
|
|
|
|
|
|
switch (0) {
|
|
|
|
default:
|
2014-05-01 16:48:18 +00:00
|
|
|
int x; // WARNING (was "no statement" ERROR, but spec. changed because unclear what a statement is)
|
2014-03-17 22:48:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (c) {
|
|
|
|
case 1:
|
|
|
|
{
|
|
|
|
int nestedX;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
nestedX; // ERROR
|
2014-05-01 16:48:18 +00:00
|
|
|
int nestedZ;
|
|
|
|
float a; // okay, hiding outer 'a'
|
2014-03-17 22:48:25 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
int linearZ;
|
|
|
|
break;
|
2015-05-03 22:38:16 +00:00
|
|
|
break;
|
2014-03-17 22:48:25 +00:00
|
|
|
case 4:
|
|
|
|
int linearY = linearZ;
|
|
|
|
break;
|
2014-05-01 16:48:18 +00:00
|
|
|
case 5: // okay that branch bypassed an initializer
|
2014-03-17 22:48:25 +00:00
|
|
|
const int linearC = 4;
|
|
|
|
break;
|
2014-05-01 16:48:18 +00:00
|
|
|
case 6: // okay that branch bypassed an initializer
|
2014-03-17 22:48:25 +00:00
|
|
|
linearC;
|
|
|
|
}
|
2014-05-01 16:48:18 +00:00
|
|
|
nestedZ; // ERROR, no longer in scope
|
2013-04-12 03:57:02 +00:00
|
|
|
}
|