blob: b77aedf6e54a6b7beee83da79498689e3cf6ec60 [file] [log] [blame]
John Kessenichdadf9452013-02-11 00:54:44 +00001#version 100
2
John Kessenichfb7044a2013-06-13 20:16:43 +00003float gu[]; // ERROR
John Kessenichdadf9452013-02-11 00:54:44 +00004float g4[4];
5float g5[5];
6
7uniform int a;
8
9float[4] foo(float[5] a) // ERROR // ERROR
10{
11 return float[](a[0], a[1], a[2], a[3]); // ERROR
12}
13
14void bar(float[5]) {}
15
16void main()
17{
18 {
19 float gu[2]; // okay, new scope
20
21 gu[2] = 4.0; // ERROR, overflow
22 }
23
John Kessenich816e9bc2013-10-04 21:09:36 +000024 g4 = foo(g5); // ERROR
John Kessenichdadf9452013-02-11 00:54:44 +000025 g5 = g4; // ERROR
26 gu = g4; // ERROR
27
28 foo(gu); // ERROR
29 bar(g5);
30
31 if (float[4](1.0, 2.0, 3.0, 4.0) == g4) // ERROR
32 gu[0] = 2.0;
33
John Kessenichdadf9452013-02-11 00:54:44 +000034 float u[5];
35 u[5] = 5.0; // ERROR
36 foo(u); // okay
37
38 gl_FragData[1000] = vec4(1.0); // ERROR
39 gl_FragData[-1] = vec4(1.0); // ERROR
40 gl_FragData[3] = vec4(1.0);
41}
John Kessenich67c9f3a2013-11-12 01:02:51 +000042
43struct SA {
44 vec3 v3;
45 vec2 v2[4];
46};
47
48struct SB {
49 vec4 v4;
50 SA sa;
51};
52
53SB bar9()
54{
55 SB s;
56 return s; // ERROR
57}
58
59void bar10(SB s) // okay
60{
61}
62
63void bar11()
64{
65 SB s1, s2;
66 s1 = s2; // ERROR
67 bar10(s1);
68 s2 = bar9(); // ERROR
John Kessenichffa66d32013-11-12 22:02:36 +000069 SB initSb = s1; // ERROR
John Kessenich67c9f3a2013-11-12 01:02:51 +000070}