yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
735a2efa
main
1#version 300 es 2precision highp float ; 3uniform int c, d; 4in highp float x; 5 6void main() 7{ 8float f; 9int a[ 2 ]; 10 11switch (f) { // ERROR 12} 13 14switch (a) { // ERROR 15} 16 17switch (c) 18{ 19} 20 21switch (c) // WARNING, not enough stuff after last label 22{ 23case 2 : 24} 25 26switch (c) 27{ 28f = sin(x); // ERRROR 29case 2 : 30f = cos(x); 31break ; 32} 33 34switch (c) { 35default : 36break ; 37case 1 : 38f = sin(x); 39break ; 40case 2 : 41f = cos(x); 42break ; 43default : // ERROR, 2nd default 44f = tan(x); 45} 46 47switch (c) { 48case 1 : 49f = sin(x); 50break ; 51case 2 : 52switch (d) { 53case 1 : 54f = x * x * x; 55break ; 56case 2 : 57f = x * x; 58break ; 59} 60break ; 61default : 62f = tan(x); 63case 1 : // ERROR, 2nd 'case 1' 64break ; 65case 3.8 : // ERROR, non-int 66break ; 67case c: // ERROR, non-constant 68break ; 69} 70 71switch (c) { // a no-error normal switch 72case 1 : 73f = sin(x); 74break ; 75case 2 : 76switch (d) { 77case 1 : 78f = x * x * x; 79break ; 80case 2 : 81f = x * x; 82break ; 83} 84break ; 85default : 86f = tan(x); 87} 88 89break ; // ERROR 90 91switch (c) { 92case 1 : 93f = sin(x); 94break ; 95case 2 : 96switch (d) { 97case 1 : 98{ 99case 4 : // ERROR 100break ; 101} 102f = x * x * x; 103if (c < d) { 104case 2 : // ERROR 105f = x * x; 106} 107if (d < c) 108case 3 : // ERROR 109break ; 110} 111break ; 112case 4 : 113f = tan(x); 114if (f < 0.0 ) 115default : // ERROR 116break ; 117} 118 119case 5 : // ERROR 120default : // ERROR 121 122switch ( 0 ) { 123default : 124int onlyInSwitch = 0 ; 125} 126onlyInSwitch; // ERROR 127128 switch ( 0 ) { 129default : 130int x; // WARNING (was "no statement" ERROR, but spec. changed because unclear what a statement is) 131} 132 133switch (c) { 134case 1 : 135{ 136int nestedX; 137break ; 138} 139case 2 : 140nestedX; // ERROR 141int nestedZ; 142float a; // okay, hiding outer 'a' 143break ; 144case 3 : 145int linearZ; 146break ; 147break ; 148case 4 : 149int linearY = linearZ; 150break ; 151case 5 : // okay that branch bypassed an initializer 152const int linearC = 4 ; 153break ; 154case 6 : // okay that branch bypassed an initializer 155linearC; 156} 157nestedZ; // ERROR, no longer in scope 158}