1#version 100
2
3varying vec3 color;       // ERRROR, there is no default qualifier for float
4
5lowp vec2 foo(mediump vec3 mv3)
6{
7    highp vec4 hv4;
8    return hv4.xy;
9}
10
11int global_medium;
12
13uniform lowp sampler2D samplerLow;
14uniform mediump sampler2D samplerMed;
15uniform highp sampler2D samplerHigh;
16
17precision highp int;
18precision highp ivec2;     // ERROR
19precision mediump int[2];  // ERROR
20vec4 uint;                 // okay
21precision mediump vec4;    // ERROR
22
23int global_high;
24
25void main()
26{
27    lowp int sum = global_medium + global_high;
28
29    gl_FragColor = vec4(color, 1.0);
30
31    int level1_high;
32    sum += level1_high;
33
34    precision lowp int;
35    int level1_low;
36    sum += level1_low;
37
38    // test maxing precisions of args to get precision of builtin
39    lowp float arg1;
40    mediump float arg2;
41    lowp float d = distance(arg1, arg2);
42
43    {
44        int level2_low;
45        sum += level2_low;
46
47        precision highp int;
48        int level2_high;
49        sum += level2_high;
50        do {
51            if (true) {
52                precision mediump int;
53                int level4_medium;
54                sum += level4_medium;
55            }
56            int level3_high;
57            sum += level3_high;
58        } while (true);
59        int level2_high2;
60        sum += level2_high2;
61    }
62    int level1_low3;
63    sum += level1_low3;
64
65    sum += 4 + ((ivec2(level1_low3) * ivec2(level1_high) + ivec2((/* comma operator */level1_low3, level1_high)))).x;
66
67    texture2D(samplerLow, vec2(0.1, 0.2));
68    texture2D(samplerMed, vec2(0.1, 0.2));
69    texture2D(samplerHigh, vec2(0.1, 0.2));
70}
71
72precision mediump bool;                 // ERROR
73//precision mediump struct { int a; } s;  // ERROR
74struct s {int a;};
75precision mediump s;                    // ERROR
76mediump bvec2 b2;                       // ERROR
77