blob: cb78f8bf023bc40975de87ef6052e8d72be0ba53 [file] [log] [blame]
John Kessenich77d908a2013-11-09 00:18:22 +00001// okay
John Kessenich816e9bc2013-10-04 21:09:36 +00002#version 100
John Kessenich816e9bc2013-10-04 21:09:36 +00003int a[3] = { 2, 3, 4, }; // ERROR
4
5int uint;
6
7attribute vec4 v[3]; // ERROR
8
9float f = 2; // ERROR
10
11uniform block { // ERROR
12 int x;
13};
14
15void foo(float);
16
17void main()
18{
19 foo(3); // ERROR
20 int s = 1 << 4; // ERROR
21 s = 16 >> 2; // ERROR
22 if (a == a); // ERROR
23 int b, c;
24 b = c & 4; // ERROR
25 b = c % 4; // ERROR
26 b = c | 4; // ERROR
27 b >>= 2; // ERROR
28 b <<= 2; // ERROR
29 b %= 3; // ERROR
30
31 struct S {
32 float f;
33 float a[10];
34 } s1, s2;
35
36 s1 = s2; // ERROR
37 if (s1 == s2); // ERROR
38 if (s1 != s2); // ERROR
39
40 switch(b) { // ERROR
41 }
42}
43
44invariant gl_FragColor;
45float fa[]; // ERROR
John Kessenich01c22af2013-11-08 07:13:18 +000046float f13;
47invariant f13; // ERROR
48struct S { int a; };
49invariant S;
50invariant float fi; // ERROR
51varying vec4 av;
52invariant av; // okay in v100
53
54void foo10()
55{
56 invariant f; // ERROR
57 invariant float f2; // ERROR
58 float f3;
59 invariant f3; // ERROR
60}
61
62uniform vec2 uv2;
63invariant uv2; // ERROR
64invariant uniform vec3 uv3; // ERROR
65
66sampler2D glob2D; // ERROR
67void f11(sampler2D p2d)
68{
69 sampler2D v2D; // ERROR
70}
71varying sampler2D vary2D; // ERROR
72
73struct sp {
74 highp float f;
75 in float g; // ERROR
76 uniform float h; // ERROR
77 invariant float i; // ERROR
78};
John Kessenich115a0ad2013-11-11 18:50:06 +000079
80uniform sampler3D s3D; // ERROR
81
82#extension GL_OES_texture_3D : enable
83
84precision highp sampler3D;
85uniform sampler3D s3D2;
86
87void foo234()
88{
89 texture3D(s3D2, vec3(0.2), 0.2);
90 texture3DProj(s3D2, v[1], 0.4);
John Kessenich06a37c32013-11-11 20:31:45 +000091 dFdx(v[0]); // ERROR
92 dFdy(3.2); // ERROR
93 fwidth(f13); // ERROR
94}
95
96#extension GL_OES_standard_derivatives : enable
97
98void foo236()
99{
100 dFdx(v[0]);
101 dFdy(3.2);
102 fwidth(f13);
John Kessenich99296362013-11-11 20:51:50 +0000103 gl_FragDepth = f13; // ERROR
104 gl_FragDepthEXT = f13; // ERROR
John Kessenich115a0ad2013-11-11 18:50:06 +0000105}
John Kessenich99296362013-11-11 20:51:50 +0000106
107#extension GL_EXT_frag_depth : enable
108
109void foo239()
110{
111 gl_FragDepth = f13; // ERROR
112 gl_FragDepthEXT = f13;
John Kessenichbd1a5b72013-11-11 23:29:59 +0000113}
114
115#extension GL_OES_EGL_image_external : enable
116
117uniform samplerExternalOES sExt;
118
119void foo245()
120{
121 texture2D(sExt, vec2(0.2));
122 texture2DProj(sExt, vec3(f13));
123 texture2DProj(sExt, v[2]);
124}
125
126precision mediump samplerExternalOES;
127uniform samplerExternalOES mediumExt;
128uniform highp samplerExternalOES highExt;
129
130void foo246()
131{
132 texture2D(mediumExt, vec2(0.2));
133 texture2DProj(highExt, v[2]);
134 texture3D(sExt, vec3(f13)); // ERROR
135 texture2DProjLod(sExt, vec3(f13), f13); // ERROR
John Kessenich67c9f3a2013-11-12 01:02:51 +0000136 int a;
137 ~a; // ERROR
138 a | a; // ERROR
139 a & a; // ERROR
John Kessenichbd1a5b72013-11-11 23:29:59 +0000140}
141
142#extension GL_OES_EGL_image_external : disable
143
John Kessenich67c9f3a2013-11-12 01:02:51 +0000144int foo203940(int a, float b, float a) // ERROR, a redefined
145{
146 return a;
147}
148
John Kessenichbd1a5b72013-11-11 23:29:59 +0000149uniform samplerExternalOES badExt; // syntax ERROR