• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 100
2
3int ga, gb;
4float f;
5
6uniform sampler2D fsa[3];
7uniform float fua[10];
8attribute mat3 am3;
9attribute vec2 av2;
10varying vec4 va[4];
11
12const mat2 m2 = mat2(1.0);
13const vec3 v3 = vec3(2.0);
14
15void foo(inout float a) {}
16
17int bar()
18{
19    return 1;
20}
21
22void main()
23{
24    while (ga < gb) { }
25
26    do { } while (false);
27
28    for (           ;              ;         );           // ERROR
29    for (           ;        ga==gb;         );           // ERROR
30    for (           ;              ;      f++);           // ERROR
31    for (     ga = 0;              ;         );           // ERROR
32    for ( bool a = false;          ;         );           // ERROR
33    for (float a = 0.0; a == sin(f);         );           // ERROR
34    for (  int a = 0;       a  < 10;   a *= 2);           // ERROR
35    for (  int a = 0;       a <= 20;      a++)  --a;      // ERROR
36    for (  int a = 0;       a <= 20;      a++)  { if (ga==0) a = 4; } // ERROR
37    for (float a = 0.0;   a <= 20.0; a += 2.0);
38    for (float a = 0.0;   a != 20.0; a -= 2.0)  { if (ga==0) ga = 4; }
39    for (float a = 0.0;   a == 20.0;      a--) for (float a = 0.0;   a == 20.0;      a--);  // two different 'a's, everything okay
40    for (float a = 0.0;   a <= 20.0; a += 2.0);
41    for (float a = 0.0;   a <= 20.0; a += 2.0);
42    for (float a = 0.0;   a > 2.0 * 20.0; a += v3.y);
43    for (float a = 0.0;   a >= 20.0; a += 2.0) foo(a);    // ERROR
44
45    int ia[9];
46
47    fsa[ga];  // ERROR
48    fua[ga];
49    am3[ga];  // ERROR
50    av2[ga];  // ERROR
51    va[2+ga]; // ERROR
52    m2[ga];   // ERROR
53    v3[ga/2]; // ERROR
54    ia[ga];   // ERROR
55
56    for (int a = 3; a >= 0; a--) {
57        fsa[a];
58        fua[a+2];
59        am3[3*a];
60        av2[3*a];
61        va[a-1];
62        m2[a/2];
63        v3[a];
64        ia[a];
65        ia[bar()];  // ERROR
66    }
67
68    fsa[2];
69    fua[3];
70    am3[2];
71    av2[1];
72    va[1];
73    m2[1];
74    v3[1];
75    ia[3];
76}
77