1#X1. Type:					float[5]								// An array type with 5 elements
2#X2. Return value:			float[5] func() { ... }					// Function with a 5-element array return value
3#X3. Array constructor:		float[3] (1.0, 2.0, 5.5)				// 3-element array with given elements
4#																	// Fails with array of matrices!
5#X4. As unnamed parameter:	void func(float[5]);
6#X5. Variable declaration:	float[5] a;								// Equivalent to float a[5]; (?)
7#X6. Empty brackets:		float x[] = float[] (1.0, 2.0, 3.0);	// Size of x is 3
8#							float y[] = float[3] (1.0, 2.0, 3.0);	// Size of y is 3 (equivalent)
9#							float z[] = y;							// Size of z is 3
10#X7. Testing that 2-dimensional arrays don't work:	float a[5][3];	// Illegal
11#													float[5] a[3];	// Illegal
12#X8. Testing that array declaration with dynamic variables as array size won't work.
13#X9. Testing length() operator:	z.length();							// Returns 3 for z defined before
14#X10. Test C/C++ style {}-constructor
15#X11. Test struct arrays
16#X12. Test array element access at initialization with const/dynamic values
17
18group constructor "Array constructors"
19
20	case float3
21		version 300 es
22		values
23		{
24			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
25			output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
26		}
27
28		both ""
29			#version 300 es
30			precision mediump float;
31			${DECLARATIONS}
32
33			void main()
34			{
35				${SETUP}
36				float[3] x;
37				x = float[3] (in0.z, in0.x, in0.y);
38				out0 = vec3(x[0], x[1], x[2]);
39				${OUTPUT}
40			}
41		""
42	end
43
44	case float4
45		version 300 es
46		values
47		{
48			input vec4 in0 = [ vec4(0.5, 1.0, 2.0, 0.2) | vec4(7.4, -1.0, 2.0, -1.3) | vec4(3.0, 1.6, -2.0, 0.5) ];
49			output vec4 out0 = [ vec4(2.0, 0.5, 0.2, 1.0) | vec4(2.0, 7.4, -1.3, -1.0) | vec4(-2.0, 3.0, 0.5, 1.6) ];
50		}
51
52		both ""
53			#version 300 es
54			precision mediump float;
55			${DECLARATIONS}
56
57			void main()
58			{
59				${SETUP}
60				float[4] x;
61				x = float[4] (in0.z, in0.x, in0.w, in0.y);
62				out0 = vec4(x[0], x[1], x[2], x[3]);
63				${OUTPUT}
64			}
65		""
66	end
67
68	case int3
69		version 300 es
70		values
71		{
72			input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
73			output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
74		}
75
76		both ""
77			#version 300 es
78			precision mediump int;
79			precision mediump float;
80			${DECLARATIONS}
81
82			void main()
83			{
84				${SETUP}
85				int[3] x;
86				x = int[3] (in0.z, in0.x, in0.y);
87				out0 = ivec3(x[0], x[1], x[2]);
88				${OUTPUT}
89			}
90		""
91	end
92
93	case int4
94		version 300 es
95		values
96		{
97			input ivec4 in0 = [ ivec4(0, 1, 2, 0) | ivec4(7, -1, 2, -1) | ivec4(3, 1, -2, 0) ];
98			output ivec4 out0 = [ ivec4(2, 0, 0, 1) | ivec4(2, 7, -1, -1) | ivec4(-2, 3, 0, 1) ];
99		}
100
101		both ""
102			#version 300 es
103			precision mediump int;
104			precision mediump float;
105			${DECLARATIONS}
106
107			void main()
108			{
109				${SETUP}
110				int[4] x;
111				x = int[4] (in0.z, in0.x, in0.w, in0.y);
112				out0 = ivec4(x[0], x[1], x[2], x[3]);
113				${OUTPUT}
114			}
115		""
116	end
117
118	case bool3
119		version 300 es
120		values
121		{
122			input bvec3 in0 = [ bvec3(true, true, false) ];
123			output bvec3 out0 = [ bvec3(false, true, true) ];
124		}
125
126		both ""
127			#version 300 es
128			precision mediump float;
129			${DECLARATIONS}
130
131			void main()
132			{
133				${SETUP}
134				bool[3] x;
135				x = bool[3] (in0.z, in0.x, in0.y);
136				out0 = bvec3(x[0], x[1], x[2]);
137				${OUTPUT}
138			}
139		""
140	end
141
142	case bool4
143		version 300 es
144		values
145		{
146			input bvec4 in0 = [ bvec4(true, true, false, false) ];
147			output bvec4 out0 = [ bvec4(false, true, true, false) ];
148		}
149
150		both ""
151			#version 300 es
152			precision mediump float;
153			${DECLARATIONS}
154
155			void main()
156			{
157				${SETUP}
158				bool[4] x;
159				x = bool[4] (in0.z, in0.x, in0.y, in0.w);
160				out0 = bvec4(x[0], x[1], x[2], x[3]);
161				${OUTPUT}
162			}
163		""
164	end
165
166	case struct3
167		version 300 es
168		values
169		{
170			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
171			output vec3 out0 = [ vec3(2.0, -0.5, -1.0) ];
172		}
173
174		both ""
175			#version 300 es
176			precision mediump float;
177			${DECLARATIONS}
178
179
180
181			void main()
182			{
183				${SETUP}
184
185				struct test
186				{
187					float f;
188					vec3 v;
189				};
190
191				test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
192				test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
193				test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
194
195				test[3] x = test[3] (a, b, c);
196
197				out0 = vec3(x[0].f, x[1].v.y, x[2].v.x);
198				${OUTPUT}
199			}
200		""
201	end
202
203	case struct4
204		version 300 es
205		values
206		{
207			input vec4 in0 = [ vec4(0.5, 1.0, 2.0, 1.5) ];
208			output vec4 out0 = [ vec4(2.0, -0.5, -1.0, -1.5) ];
209		}
210
211		both ""
212			#version 300 es
213			precision mediump float;
214			${DECLARATIONS}
215
216
217			void main()
218			{
219				${SETUP}
220
221
222				struct test
223				{
224					float f;
225					vec3 v;
226				};
227
228				test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
229				test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
230				test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
231				test d = test(-in0.w, vec3(-in0.w, -in0.x, -in0.z));
232
233				test[4] x = test[4] (a, b, c, d);
234
235				out0 = vec4(x[0].f, x[1].v.y, x[2].v.x, x[3].v.x);
236				${OUTPUT}
237			}
238		""
239	end
240
241
242	case float_vec3
243		version 300 es
244		values
245		{
246			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
247			output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(7.4, -2.0, -1.0) | vec3(3.0, 2.0, 1.6) ];
248		}
249
250		both ""
251			#version 300 es
252			precision mediump float;
253			${DECLARATIONS}
254
255			void main()
256			{
257				${SETUP}
258
259				vec3[3] x;
260				x = vec3[3] (	vec3(in0.x, in0.y, in0.z)	,
261								vec3(-in0.y, -in0.z, -in0.x),
262								vec3(in0.z, in0.x, in0.y)	);
263				out0 = vec3(x[0].x, x[1].y, x[2].z);
264				${OUTPUT}
265			}
266		""
267	end
268
269	case int_vec3
270		version 300 es
271		values
272		{
273			input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
274			output ivec3 out0 = [ ivec3(5, -2, 1) | ivec3(7, -2, -1) | ivec3(3, 2, 1) ];
275		}
276
277		both ""
278			#version 300 es
279			precision mediump int;
280			precision mediump float;
281			${DECLARATIONS}
282
283			void main()
284			{
285				${SETUP}
286
287				ivec3[3] x;
288				x = ivec3[3] (	ivec3(in0.x, in0.y, in0.z)	,
289								ivec3(-in0.y, -in0.z, -in0.x),
290								ivec3(in0.z, in0.x, in0.y)	);
291				out0 = ivec3(x[0].x, x[1].y, x[2].z);
292				${OUTPUT}
293			}
294		""
295	end
296
297	case bool_vec3
298		version 300 es
299		values
300		{
301			input bvec3 in0 = [ bvec3(true, false, true) ];
302			output bvec3 out0 = [ bvec3(true, true, false) ];
303		}
304
305		both ""
306			#version 300 es
307			precision mediump float;
308			${DECLARATIONS}
309
310			void main()
311			{
312				${SETUP}
313
314				bvec3[3] x;
315				x = bvec3[3] (	bvec3(in0.x, in0.y, in0.z)	,
316								bvec3(in0.y, in0.z, in0.x),
317								bvec3(in0.z, in0.x, in0.y)	);
318				out0 = bvec3(x[0].x, x[1].y, x[2].z);
319				${OUTPUT}
320			}
321		""
322	end
323
324	case float_mat3
325		version 300 es
326		values
327		{
328			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
329			output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
330		}
331
332		both ""
333			#version 300 es
334			precision mediump float;
335			${DECLARATIONS}
336
337			void main()
338			{
339				${SETUP}
340				mat3[3] a = mat3[3] (	mat3(	in0.x, in0.y, in0.z,
341												in0.x, in0.y, in0.z,
342												in0.x, in0.y, in0.z)	,
343										mat3(	in0.z, in0.x, -in0.y,
344												in0.z, in0.x, -in0.y,
345												in0.z, in0.x, -in0.y)	,
346										mat3(	-in0.z, -in0.z, in0.z,
347												-in0.y, -in0.y, in0.y,
348												-in0.x, -in0.x, in0.x)	);
349
350				mat3 a0 = a[0];
351				mat3 a1 = a[1];
352				mat3 a2 = a[2];
353
354				float ret0 = a0[2][0];
355				float ret1 = a1[0][2];
356				float ret2 = a2[1][2];
357
358				out0 = vec3(ret0, ret1, ret2);
359				${OUTPUT}
360			}
361		""
362	end
363
364	case int_mat3
365		version 300 es
366		values
367		{
368			input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
369			output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
370		}
371
372		both ""
373			#version 300 es
374			precision mediump int;
375			precision mediump float;
376			${DECLARATIONS}
377
378			void main()
379			{
380				${SETUP}
381				mat3[3] a = mat3[3] (	mat3(	in0.x, in0.y, in0.z,
382												in0.x, in0.y, in0.z,
383												in0.x, in0.y, in0.z)	,
384										mat3(	in0.z, in0.x, -in0.y,
385												in0.z, in0.x, -in0.y,
386												in0.z, in0.x, -in0.y)	,
387										mat3(	-in0.z, -in0.z, in0.z,
388												-in0.y, -in0.y, in0.y,
389												-in0.x, -in0.x, in0.x)	);
390
391				mat3 a0 = a[0];
392				mat3 a1 = a[1];
393				mat3 a2 = a[2];
394
395				float ret0 = a0[2][0];
396				float ret1 = a1[0][2];
397				float ret2 = a2[1][2];
398
399				out0 = ivec3(ret0, ret1, ret2);
400				${OUTPUT}
401			}
402		""
403	end
404
405	case bool_mat3
406		version 300 es
407		values
408		{
409			input bvec3 in0 = [ bvec3(true, false, true) ];
410			output bvec3 out0 = [ bvec3(true, false, false) ];
411		}
412
413		both ""
414			#version 300 es
415			precision mediump float;
416			${DECLARATIONS}
417
418			void main()
419			{
420				${SETUP}
421				mat3[3] a = mat3[3] (	mat3(	in0.x, in0.y, in0.z,
422												in0.x, in0.y, in0.z,
423												in0.x, in0.y, in0.z)	,
424										mat3(	in0.z, in0.x, in0.y,
425												in0.z, in0.x, in0.y,
426												in0.z, in0.x, in0.y)	,
427										mat3(	in0.z, in0.z, in0.z,
428												in0.y, in0.y, in0.y,
429												in0.x, in0.x, in0.x)	);
430
431				mat3 a0 = a[0];
432				mat3 a1 = a[1];
433				mat3 a2 = a[2];
434
435				float ret0 = a0[2][0];
436				float ret1 = a1[0][2];
437				float ret2 = a2[1][2];
438
439				out0 = bvec3(ret0, ret1, ret2);
440				${OUTPUT}
441			}
442		""
443	end
444
445end # type
446
447group return "Arrays as return value"
448
449	case float
450		version 300 es
451		values
452		{
453			input vec3 in0 =	[ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
454			output vec3 out0 = [ vec3(2.0, -0.5, 1.0) | vec3(2.0, -7.4, -1.0) | vec3(-2.0, -3.0, 1.6) ];
455		}
456
457		both ""
458			#version 300 es
459			precision mediump float;
460			${DECLARATIONS}
461
462			float[3] func(vec3 a)
463			{
464				return float[3] (a.z, -a.x, a.y);
465			}
466
467			void main()
468			{
469				${SETUP}
470				float[3] x = func(in0);
471				out0 = vec3(x[0], x[1], x[2]);
472				${OUTPUT}
473			}
474		""
475	end
476
477	case int
478		version 300 es
479		values
480		{
481			input ivec3 in0 = [ ivec3(4, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
482			output ivec3 out0 =	[ ivec3(2, -4, 1) | ivec3(2, -7, -1) | ivec3(-2, -3, 1) ];
483		}
484
485		both ""
486			#version 300 es
487			precision mediump int;
488			precision mediump float;
489			${DECLARATIONS}
490
491			int[3] func(ivec3 a)
492			{
493				return int[3] (a.z, -a.x, a.y);
494			}
495
496			void main()
497			{
498				${SETUP}
499				int[3] x = func(in0);
500				out0 = ivec3(x[0], x[1], x[2]);
501				${OUTPUT}
502			}
503		""
504	end
505
506	case bool
507		version 300 es
508		values
509		{
510			input bvec3 in0 =	[ bvec3(false, true, true) ];
511			output bvec3 out0 = [ bvec3(true, false, true) ];
512		}
513
514		both ""
515			#version 300 es
516			precision mediump float;
517			${DECLARATIONS}
518
519			bool[3] func(bvec3 a)
520			{
521				return bool[3] (a.z, a.x, a.y);
522			}
523
524			void main()
525			{
526				${SETUP}
527				bool[3] x = func(in0);
528				out0 = bvec3(x[0], x[1], x[2]);
529				${OUTPUT}
530			}
531		""
532	end
533
534
535
536	case float_vec3
537		version 300 es
538		values
539		{
540			input vec3 in0 =	[ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
541			output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ];
542		}
543
544		both ""
545			#version 300 es
546			precision mediump float;
547			${DECLARATIONS}
548
549			vec3[3] func(vec3[3] a)
550			{
551				return vec3[3] (a[1], a[2], a[0]);
552			}
553
554			void main()
555			{
556				${SETUP}
557				vec3[3] x = vec3[3](vec3(in0.x, in0.y, -in0.z)	,
558									vec3(in0.y, -in0.z, in0.x)	,
559									vec3(-in0.z, in0.x, in0.y)	);
560				x = func(x);
561				out0 = vec3(x[0].x, x[1].y, x[2].z);
562				${OUTPUT}
563			}
564		""
565	end
566
567	case struct
568		version 300 es
569		values
570		{
571			input vec3 in0 =	[ vec3(0.5, 1.0, 2.0) ];
572			output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ];
573		}
574
575		both ""
576			#version 300 es
577			precision mediump float;
578			${DECLARATIONS}
579
580			struct test
581			{
582				float f;
583				vec3 v;
584			};
585
586			test[3] func(test[3] a)
587			{
588				return test[3] (a[1], a[2], a[0]);
589			}
590
591			void main()
592			{
593				${SETUP}
594
595				test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
596				test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
597				test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
598
599				test[3] t = test[3] (a, b, c);
600				test[3] x = func(t);
601
602				out0 = vec3(x[0].v.z, x[1].v.y, x[2].v.x);
603				${OUTPUT}
604			}
605		""
606	end
607
608	case int_vec3
609		version 300 es
610		values
611		{
612			input ivec3 in0 =	[ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ];
613			output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ];
614		}
615
616		both ""
617			#version 300 es
618			precision mediump int;
619			precision mediump float;
620			${DECLARATIONS}
621
622			ivec3[3] func(ivec3[3] a)
623			{
624				return ivec3[3] (a[1], a[2], a[0]);
625			}
626
627			void main()
628			{
629				${SETUP}
630				ivec3[3] x = ivec3[3](	ivec3(in0.x, in0.y, -in0.z)	,
631										ivec3(in0.y, -in0.z, in0.x)	,
632										ivec3(-in0.z, in0.x, in0.y)	);
633				x = func(x);
634				out0 = ivec3(x[0].x, x[1].y, x[2].z);
635				${OUTPUT}
636			}
637		""
638	end
639
640	case bool_vec3
641		version 300 es
642		values
643		{
644			input bvec3 in0 =	[ bvec3(true, false, false) ];
645			output bvec3 out0 = [ bvec3(false, true, false) ];
646		}
647
648		both ""
649			#version 300 es
650			precision mediump int;
651			precision mediump float;
652			${DECLARATIONS}
653
654			bvec3[3] func(bvec3[3] a)
655			{
656				return bvec3[3] (a[1], a[2], a[0]);
657			}
658
659			void main()
660			{
661				${SETUP}
662				bvec3[3] x = bvec3[3](	bvec3(in0.x, in0.y, in0.z)	,
663										bvec3(in0.y, in0.z, in0.x)	,
664										bvec3(in0.z, in0.x, in0.y)	);
665				x = func(x);
666				out0 = bvec3(x[0].x, x[1].y, x[2].z);
667				${OUTPUT}
668			}
669		""
670	end
671
672	case float_mat3
673		version 300 es
674		values
675		{
676			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
677			output vec3 out0 = [ vec3(2.0, -1.0, 2.0) | vec3(-2.3, 0.0, -2.3) ];
678		}
679
680		both ""
681			#version 300 es
682			precision mediump float;
683			${DECLARATIONS}
684
685			mat3[3] func(mat3[3] x)
686			{
687				mat3[3] r;
688				r[0] = x[1];
689				r[1] = x[2];
690				r[2] = x[0];
691				return r;
692			}
693
694			void main()
695			{
696				${SETUP}
697				mat3[3] a, b;
698				a[0] = mat3(in0.x, in0.y, in0.z,
699							in0.x, in0.y, in0.z,
700							in0.x, in0.y, in0.z);
701				a[1] = mat3(in0.z, in0.x, -in0.y,
702							in0.z, in0.x, -in0.y,
703							in0.z, in0.x, -in0.y);
704				a[2] = mat3(-in0.z, -in0.z, in0.z,
705							-in0.y, -in0.y, in0.y,
706							-in0.x, -in0.x, in0.x);
707
708				b = func(a);
709
710				mat3 b0 = b[0];
711				mat3 b1 = b[1];
712				mat3 b2 = b[2];
713
714				float ret0 = b0[0][0];
715				float ret1 = b1[1][1];
716				float ret2 = b2[2][2];
717
718				out0 = vec3(ret0, ret1, ret2);
719				${OUTPUT}
720			}
721		""
722	end
723
724	case int_mat3
725		version 300 es
726		values
727		{
728			input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-1, 0, -2) ];
729			output ivec3 out0 = [ ivec3(2, -1, 2) | ivec3(-2, 0, -2) ];
730		}
731
732		both ""
733			#version 300 es
734			precision mediump int;
735			precision mediump float;
736			${DECLARATIONS}
737
738			mat3[3] func(mat3[3] x)
739			{
740				mat3[3] r;
741				r[0] = x[1];
742				r[1] = x[2];
743				r[2] = x[0];
744				return r;
745			}
746
747			void main()
748			{
749				${SETUP}
750				mat3[3] a, b;
751				a[0] = mat3(in0.x, in0.y, in0.z,
752							in0.x, in0.y, in0.z,
753							in0.x, in0.y, in0.z);
754				a[1] = mat3(in0.z, in0.x, -in0.y,
755							in0.z, in0.x, -in0.y,
756							in0.z, in0.x, -in0.y);
757				a[2] = mat3(-in0.z, -in0.z, in0.z,
758							-in0.y, -in0.y, in0.y,
759							-in0.x, -in0.x, in0.x);
760
761				b = func(a);
762
763				mat3 b0 = b[0];
764				mat3 b1 = b[1];
765				mat3 b2 = b[2];
766
767				float ret0 = b0[0][0];
768				float ret1 = b1[1][1];
769				float ret2 = b2[2][2];
770
771				out0 = ivec3(ret0, ret1, ret2);
772				${OUTPUT}
773			}
774		""
775	end
776
777	case bool_mat3
778		version 300 es
779		values
780		{
781			input bvec3 in0 = [ bvec3(true, false, true) | bvec3(true, true, false) ];
782			output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, false) ];
783		}
784
785		both ""
786			#version 300 es
787			precision mediump float;
788			${DECLARATIONS}
789
790			mat3[3] func(mat3[3] x)
791			{
792				mat3[3] r;
793				r[0] = x[1];
794				r[1] = x[2];
795				r[2] = x[0];
796				return r;
797			}
798
799			void main()
800			{
801				${SETUP}
802				mat3[3] a, b;
803				a[0] = mat3(in0.x, in0.y, in0.z,
804							in0.x, in0.y, in0.z,
805							in0.x, in0.y, in0.z);
806				a[1] = mat3(in0.z, in0.x, in0.y,
807							in0.z, in0.x, in0.y,
808							in0.z, in0.x, in0.y);
809				a[2] = mat3(in0.z, in0.z, in0.z,
810							in0.y, in0.y, in0.y,
811							in0.x, in0.x, in0.x);
812
813				b = func(a);
814
815				mat3 b0 = b[0];
816				mat3 b1 = b[1];
817				mat3 b2 = b[2];
818
819				float ret0 = b0[0][0];
820				float ret1 = b1[1][1];
821				float ret2 = b2[2][2];
822
823				out0 = bvec3(ret0, ret1, ret2);
824				${OUTPUT}
825			}
826		""
827	end
828
829end # return
830
831group unnamed_parameter "Array type as unnamed parameter of a function prototype"
832
833	case float
834		version 300 es
835		values
836		{
837			input vec3 in0 =	[ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
838			output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
839		}
840
841		both ""
842			#version 300 es
843			precision mediump float;
844			${DECLARATIONS}
845
846			float[3] func(float[3]);
847
848			void main()
849			{
850				${SETUP}
851				float[3] a = float[3] (in0.x, in0.y, in0.z);
852				float[3] b = func(a);
853				out0 = vec3(b[0], b[1], b[2]);
854				${OUTPUT}
855			}
856
857			float[3] func(float[3] a)
858			{
859				return float[3] (a[2], a[0], a[1]);
860			}
861
862		""
863	end
864
865	case int
866		version 300 es
867		values
868		{
869			input ivec3 in0 =	[ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
870			output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
871		}
872
873		both ""
874			#version 300 es
875			precision mediump int;
876			precision mediump float;
877			${DECLARATIONS}
878
879			int[3] func(int[3]);
880
881			void main()
882			{
883				${SETUP}
884				int[3] a = int[3] (in0.x, in0.y, in0.z);
885				int[3] b = func(a);
886				out0 = ivec3(b[0], b[1], b[2]);
887				${OUTPUT}
888			}
889
890			int[3] func(int[3] a)
891			{
892				return int[3] (a[2], a[0], a[1]);
893			}
894
895		""
896	end
897
898	case bool
899		version 300 es
900		values
901		{
902			input bvec3 in0 =	[ bvec3(false, true, true) ];
903			output bvec3 out0 = [ bvec3(true, false, true) ];
904		}
905
906		both ""
907			#version 300 es
908			precision mediump float;
909			${DECLARATIONS}
910
911			bool[3] func(bool[3]);
912
913			void main()
914			{
915				${SETUP}
916				bool[3] a = bool[3] (in0.x, in0.y, in0.z);
917				bool[3] b = func(a);
918				out0 = bvec3(b[0], b[1], b[2]);
919				${OUTPUT}
920			}
921
922			bool[3] func(bool[3] a)
923			{
924				return bool[3] (a[2], a[0], a[1]);
925			}
926
927		""
928	end
929
930	case struct
931		version 300 es
932		values
933		{
934			input vec3 in0 =	[ vec3(0.5, 1.0, 2.0) ];
935			output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ];
936		}
937
938		both ""
939			#version 300 es
940			precision mediump float;
941			${DECLARATIONS}
942
943			struct test
944			{
945				float f;
946				vec3 v;
947			};
948
949			test[3] func(test[3]);
950
951			void main()
952			{
953				${SETUP}
954
955				test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
956				test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
957				test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
958
959				test[3] t = test[3] (a, b, c);
960				test[3] x = func(t);
961				out0 = vec3(x[0].v.z, x[1].v.y, x[2].v.x);
962				${OUTPUT}
963			}
964
965			test[3] func(test[3] a)
966			{
967				return test[3] (a[1], a[2], a[0]);
968			}
969
970		""
971	end
972
973	case float_vec3
974		version 300 es
975		values
976		{
977			input vec3 in0 =	[ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
978			output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ];
979		}
980
981		both ""
982			#version 300 es
983			precision mediump float;
984			${DECLARATIONS}
985
986			vec3[3] func(vec3[3]);
987
988			void main()
989			{
990				${SETUP}
991				vec3[3] x = vec3[3](vec3(in0.x, in0.y, -in0.z)	,
992									vec3(in0.y, -in0.z, in0.x)	,
993									vec3(-in0.z, in0.x, in0.y)	);
994				x = func(x);
995				out0 = vec3(x[0].x, x[1].y, x[2].z);
996				${OUTPUT}
997			}
998
999			vec3[3] func(vec3[3] a)
1000			{
1001				return vec3[3] (a[1], a[2], a[0]);
1002			}
1003		""
1004	end
1005
1006	case int_vec3
1007		version 300 es
1008		values
1009		{
1010			input ivec3 in0 =	[ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ];
1011			output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ];
1012		}
1013
1014		both ""
1015			#version 300 es
1016			precision mediump int;
1017			precision mediump float;
1018			${DECLARATIONS}
1019
1020			ivec3[3] func(ivec3[3]);
1021
1022			void main()
1023			{
1024				${SETUP}
1025				ivec3[3] x = ivec3[3](	ivec3(in0.x, in0.y, -in0.z)	,
1026										ivec3(in0.y, -in0.z, in0.x)	,
1027										ivec3(-in0.z, in0.x, in0.y)	);
1028				x = func(x);
1029				out0 = ivec3(x[0].x, x[1].y, x[2].z);
1030				${OUTPUT}
1031			}
1032
1033			ivec3[3] func(ivec3[3] a)
1034			{
1035				return ivec3[3] (a[1], a[2], a[0]);
1036			}
1037		""
1038	end
1039
1040	case bool_vec3
1041		version 300 es
1042		values
1043		{
1044			input bvec3 in0 =	[ bvec3(true, false, false) ];
1045			output bvec3 out0 = [ bvec3(false, true, false) ];
1046		}
1047
1048		both ""
1049			#version 300 es
1050			precision mediump int;
1051			precision mediump float;
1052			${DECLARATIONS}
1053
1054			bvec3[3] func(bvec3[3]);
1055
1056			void main()
1057			{
1058				${SETUP}
1059				bvec3[3] x = bvec3[3](	bvec3(in0.x, in0.y, in0.z)	,
1060										bvec3(in0.y, in0.z, in0.x)	,
1061										bvec3(in0.z, in0.x, in0.y)	);
1062				x = func(x);
1063				out0 = bvec3(x[0].x, x[1].y, x[2].z);
1064				${OUTPUT}
1065			}
1066
1067			bvec3[3] func(bvec3[3] a)
1068			{
1069				return bvec3[3] (a[1], a[2], a[0]);
1070			}
1071
1072		""
1073	end
1074
1075	case float_mat3
1076		version 300 es
1077		values
1078		{
1079			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
1080			output vec3 out0 = [ vec3(2.0, -1.0, 2.0) | vec3(-2.3, 0.0, -2.3) ];
1081		}
1082
1083		both ""
1084			#version 300 es
1085			precision mediump float;
1086			${DECLARATIONS}
1087
1088			mat3[3] func(mat3[3]);
1089
1090			void main()
1091			{
1092				${SETUP}
1093				mat3[3] a, b;
1094				a[0] = mat3(in0.x, in0.y, in0.z,
1095							in0.x, in0.y, in0.z,
1096							in0.x, in0.y, in0.z);
1097				a[1] = mat3(in0.z, in0.x, -in0.y,
1098							in0.z, in0.x, -in0.y,
1099							in0.z, in0.x, -in0.y);
1100				a[2] = mat3(-in0.z, -in0.z, in0.z,
1101							-in0.y, -in0.y, in0.y,
1102							-in0.x, -in0.x, in0.x);
1103
1104				b = func(a);
1105
1106				mat3 b0 = b[0];
1107				mat3 b1 = b[1];
1108				mat3 b2 = b[2];
1109
1110				float ret0 = b0[0][0];
1111				float ret1 = b1[1][1];
1112				float ret2 = b2[2][2];
1113
1114				out0 = vec3(ret0, ret1, ret2);
1115				${OUTPUT}
1116			}
1117
1118			mat3[3] func(mat3[3] x)
1119			{
1120				mat3[3] r;
1121				r[0] = x[1];
1122				r[1] = x[2];
1123				r[2] = x[0];
1124				return r;
1125			}
1126		""
1127	end
1128
1129	case int_mat3
1130		version 300 es
1131		values
1132		{
1133			input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-1, 0, -2) ];
1134			output ivec3 out0 = [ ivec3(2, -1, 2) | ivec3(-2, 0, -2) ];
1135		}
1136
1137		both ""
1138			#version 300 es
1139			precision mediump int;
1140			precision mediump float;
1141			${DECLARATIONS}
1142
1143			mat3[3] func(mat3[3]);
1144
1145			void main()
1146			{
1147				${SETUP}
1148				mat3[3] a, b;
1149				a[0] = mat3(in0.x, in0.y, in0.z,
1150							in0.x, in0.y, in0.z,
1151							in0.x, in0.y, in0.z);
1152				a[1] = mat3(in0.z, in0.x, -in0.y,
1153							in0.z, in0.x, -in0.y,
1154							in0.z, in0.x, -in0.y);
1155				a[2] = mat3(-in0.z, -in0.z, in0.z,
1156							-in0.y, -in0.y, in0.y,
1157							-in0.x, -in0.x, in0.x);
1158
1159				b = func(a);
1160
1161				mat3 b0 = b[0];
1162				mat3 b1 = b[1];
1163				mat3 b2 = b[2];
1164
1165				float ret0 = b0[0][0];
1166				float ret1 = b1[1][1];
1167				float ret2 = b2[2][2];
1168
1169				out0 = ivec3(ret0, ret1, ret2);
1170				${OUTPUT}
1171			}
1172
1173			mat3[3] func(mat3[3] x)
1174			{
1175				mat3[3] r;
1176				r[0] = x[1];
1177				r[1] = x[2];
1178				r[2] = x[0];
1179				return r;
1180			}
1181		""
1182	end
1183
1184	case bool_mat3
1185		version 300 es
1186		values
1187		{
1188			input bvec3 in0 = [ bvec3(true, false, true) | bvec3(true, true, false) ];
1189			output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, false) ];
1190		}
1191
1192		both ""
1193			#version 300 es
1194			precision mediump float;
1195			${DECLARATIONS}
1196
1197			mat3[3] func(mat3[3]);
1198			void main()
1199			{
1200				${SETUP}
1201				mat3[3] a, b;
1202				a[0] = mat3(in0.x, in0.y, in0.z,
1203							in0.x, in0.y, in0.z,
1204							in0.x, in0.y, in0.z);
1205				a[1] = mat3(in0.z, in0.x, in0.y,
1206							in0.z, in0.x, in0.y,
1207							in0.z, in0.x, in0.y);
1208				a[2] = mat3(in0.z, in0.z, in0.z,
1209							in0.y, in0.y, in0.y,
1210							in0.x, in0.x, in0.x);
1211
1212				b = func(a);
1213
1214				mat3 b0 = b[0];
1215				mat3 b1 = b[1];
1216				mat3 b2 = b[2];
1217
1218				float ret0 = b0[0][0];
1219				float ret1 = b1[1][1];
1220				float ret2 = b2[2][2];
1221
1222				out0 = bvec3(ret0, ret1, ret2);
1223				${OUTPUT}
1224			}
1225
1226			mat3[3] func(mat3[3] x)
1227			{
1228				mat3[3] r;
1229				r[0] = x[1];
1230				r[1] = x[2];
1231				r[2] = x[0];
1232				return r;
1233			}
1234		""
1235	end
1236
1237end # unnamed_parameter
1238
1239group declaration "Declaring arrays"
1240
1241	case implicit_size_float
1242		version 300 es
1243		values
1244		{
1245			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
1246			output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
1247		}
1248
1249		both ""
1250			#version 300 es
1251			precision mediump float;
1252			${DECLARATIONS}
1253
1254			void main()
1255			{
1256				${SETUP}
1257				float[] x = float[] (in0.z, in0.x, in0.y);
1258				float[] y = x;
1259
1260				out0 = vec3(y[0], y[1], y[2]);
1261				${OUTPUT}
1262			}
1263		""
1264	end
1265
1266	case implicit_size_int
1267		version 300 es
1268		values
1269		{
1270			input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
1271			output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
1272		}
1273
1274		both ""
1275			#version 300 es
1276			precision mediump int;
1277			precision mediump float;
1278			${DECLARATIONS}
1279
1280			void main()
1281			{
1282				${SETUP}
1283				int[] x = int[] (in0.z, in0.x, in0.y);
1284				int[] y = x;
1285
1286				out0 = ivec3(y[0], y[1], y[2]);
1287				${OUTPUT}
1288			}
1289		""
1290	end
1291
1292	case implicit_size_bool
1293		version 300 es
1294		values
1295		{
1296			input bvec3 in0 = [ bvec3(false, true, true) ];
1297			output bvec3 out0 = [ bvec3(true, false, true) ];
1298		}
1299
1300		both ""
1301			#version 300 es
1302			precision mediump float;
1303			${DECLARATIONS}
1304
1305			void main()
1306			{
1307				${SETUP}
1308				bool[] x = bool[] (in0.z, in0.x, in0.y);
1309				bool[] y = x;
1310
1311				out0 = bvec3(y[0], y[1], y[2]);
1312				${OUTPUT}
1313			}
1314		""
1315	end
1316
1317	case implicit_size_struct
1318		version 300 es
1319		values
1320		{
1321			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1322			output vec3 out0 = [ vec3(-1.0, -0.5, 2.0) ];
1323		}
1324
1325		both ""
1326			#version 300 es
1327			precision mediump float;
1328			${DECLARATIONS}
1329
1330			struct test
1331			{
1332				float f;
1333				vec3 v;
1334			};
1335
1336			void main()
1337			{
1338				${SETUP}
1339
1340				test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
1341				test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
1342				test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
1343
1344				test[] x = test[] (c, b, a);
1345				test[] y = x;
1346
1347				out0 = vec3(y[0].v.x, y[1].v.y, y[2].v.z);
1348				${OUTPUT}
1349			}
1350		""
1351	end
1352
1353	case implicit_size_float_vec3
1354		version 300 es
1355		values
1356		{
1357			input vec3 in0 =	[ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
1358			output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(-0.5, 1.0, 11.2) ];
1359		}
1360
1361		both ""
1362			#version 300 es
1363			precision mediump float;
1364			${DECLARATIONS}
1365
1366			void main()
1367			{
1368				${SETUP}
1369				vec3[] x = vec3[] (	vec3(in0.x, in0.y, -in0.z)	,
1370									vec3(in0.y, -in0.z, in0.x)	,
1371									vec3(-in0.z, in0.x, in0.y)	);
1372				vec3[] y = x;
1373				out0 = vec3(y[0].x, y[1].y, y[2].z);
1374				${OUTPUT}
1375			}
1376		""
1377	end
1378
1379	case implicit_size_int_ivec3
1380		version 300 es
1381		values
1382		{
1383			input ivec3 in0 =	[ ivec3(0, 1, 2) | ivec3(5, 11, -1) ];
1384			output ivec3 out0 = [ ivec3(0, -2, 1) | ivec3(5, 1, 11) ];
1385		}
1386
1387		both ""
1388			#version 300 es
1389			precision mediump int;
1390			precision mediump float;
1391			${DECLARATIONS}
1392
1393			void main()
1394			{
1395				${SETUP}
1396				ivec3[] x = ivec3[] (	ivec3(in0.x, in0.y, -in0.z)	,
1397										ivec3(in0.y, -in0.z, in0.x)	,
1398										ivec3(-in0.z, in0.x, in0.y)	);
1399				ivec3[] y = x;
1400				out0 = ivec3(y[0].x, y[1].y, y[2].z);
1401				${OUTPUT}
1402			}
1403		""
1404	end
1405
1406	case implicit_size_bool_bvec3
1407		version 300 es
1408		values
1409		{
1410			input bvec3 in0 =	[ bvec3(true, false, true) ];
1411			output bvec3 out0 = [ bvec3(true, true, false) ];
1412		}
1413
1414		both ""
1415			#version 300 es
1416			precision mediump float;
1417			${DECLARATIONS}
1418
1419			void main()
1420			{
1421				${SETUP}
1422				bvec3[] x = bvec3[] (	bvec3(in0.x, in0.y, in0.z)	,
1423										bvec3(in0.y, in0.z, in0.x)	,
1424										bvec3(in0.z, in0.x, in0.y)	);
1425				bvec3[] y = x;
1426				out0 = bvec3(y[0].x, y[1].y, y[2].z);
1427				${OUTPUT}
1428			}
1429		""
1430	end
1431
1432	case implicit_size_float_mat3
1433		version 300 es
1434		values
1435		{
1436			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
1437			output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
1438		}
1439
1440		both ""
1441			#version 300 es
1442			precision mediump float;
1443			${DECLARATIONS}
1444
1445			void main()
1446			{
1447				${SETUP}
1448				mat3[] a = mat3[] (	mat3(	in0.x, in0.y, in0.z,
1449											in0.x, in0.y, in0.z,
1450											in0.x, in0.y, in0.z)	,
1451									mat3(	in0.z, in0.x, -in0.y,
1452											in0.z, in0.x, -in0.y,
1453											in0.z, in0.x, -in0.y)	,
1454									mat3(	-in0.z, -in0.z, in0.z,
1455											-in0.y, -in0.y, in0.y,
1456											-in0.x, -in0.x, in0.x)	);
1457
1458				mat3 a0 = a[0];
1459				mat3 a1 = a[1];
1460				mat3 a2 = a[2];
1461
1462				float ret0 = a0[2][0];
1463				float ret1 = a1[0][2];
1464				float ret2 = a2[1][2];
1465
1466				out0 = vec3(ret0, ret1, ret2);
1467				${OUTPUT}
1468			}
1469		""
1470	end
1471
1472	case implicit_size_int_mat3
1473		version 300 es
1474		values
1475		{
1476			input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
1477			output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
1478		}
1479
1480		both ""
1481			#version 300 es
1482			precision mediump int;
1483			precision mediump float;
1484			${DECLARATIONS}
1485
1486			void main()
1487			{
1488				${SETUP}
1489				mat3[] a = mat3[] (	mat3(	in0.x, in0.y, in0.z,
1490											in0.x, in0.y, in0.z,
1491											in0.x, in0.y, in0.z)	,
1492									mat3(	in0.z, in0.x, -in0.y,
1493											in0.z, in0.x, -in0.y,
1494											in0.z, in0.x, -in0.y)	,
1495									mat3(	-in0.z, -in0.z, in0.z,
1496											-in0.y, -in0.y, in0.y,
1497											-in0.x, -in0.x, in0.x)	);
1498
1499				mat3 a0 = a[0];
1500				mat3 a1 = a[1];
1501				mat3 a2 = a[2];
1502
1503				float ret0 = a0[2][0];
1504				float ret1 = a1[0][2];
1505				float ret2 = a2[1][2];
1506
1507				out0 = ivec3(ret0, ret1, ret2);
1508				${OUTPUT}
1509			}
1510		""
1511	end
1512
1513	case implicit_size_bool_mat3
1514		version 300 es
1515		values
1516		{
1517			input bvec3 in0 = [ bvec3(true, false, true) ];
1518			output bvec3 out0 = [ bvec3(true, false, false) ];
1519		}
1520
1521		both ""
1522			#version 300 es
1523			precision mediump float;
1524			${DECLARATIONS}
1525
1526			void main()
1527			{
1528				${SETUP}
1529				mat3[] a = mat3[] (	mat3(	in0.x, in0.y, in0.z,
1530											in0.x, in0.y, in0.z,
1531											in0.x, in0.y, in0.z)	,
1532									mat3(	in0.z, in0.x, in0.y,
1533											in0.z, in0.x, in0.y,
1534											in0.z, in0.x, in0.y)	,
1535									mat3(	in0.z, in0.z, in0.z,
1536											in0.y, in0.y, in0.y,
1537											in0.x, in0.x, in0.x)	);
1538
1539				mat3 a0 = a[0];
1540				mat3 a1 = a[1];
1541				mat3 a2 = a[2];
1542
1543				float ret0 = a0[2][0];
1544				float ret1 = a1[0][2];
1545				float ret2 = a2[1][2];
1546
1547				out0 = bvec3(ret0, ret1, ret2);
1548				${OUTPUT}
1549			}
1550		""
1551	end
1552
1553
1554	case constant_expression_array_size
1555		version 300 es
1556
1557		both ""
1558			#version 300 es
1559			precision mediump float;
1560			${DECLARATIONS}
1561
1562			const int a = 4;
1563
1564			void main ()
1565			{
1566				const int b = 5;
1567				float[a] array1;
1568				float[b] array2;
1569				float[array1.length()] array3;
1570				float[a+b] array4;
1571				${OUTPUT}
1572			}
1573		""
1574	end
1575
1576	case constant_expression_array_access
1577		version 300 es
1578		values
1579		{
1580			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1581			output vec3 out0 = [ vec3(-2.0, -1.0, -0.5) ];
1582		}
1583
1584		both ""
1585			#version 300 es
1586			precision mediump float;
1587			${DECLARATIONS}
1588
1589			const int a = 3;
1590
1591			void main ()
1592			{
1593				${SETUP}
1594				const int b = 2;
1595				float x = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [a];
1596				float y = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [b+2];
1597				float z = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [5];
1598				out0 = vec3(x, y, z);
1599				${OUTPUT}
1600			}
1601		""
1602	end
1603
1604	case dynamic_expression_array_access
1605		version 300 es
1606		values
1607		{
1608			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1609			input ivec2 in1 = ivec2(3, 2);
1610			output vec3 out0 = [ vec3(-2.0, -1.0, -0.5) ];
1611		}
1612
1613		both ""
1614			#version 300 es
1615			precision mediump float;
1616			${DECLARATIONS}
1617
1618			void main ()
1619			{
1620				${SETUP}
1621				float x = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.x];
1622				float y = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.y+2];
1623				float z = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.x+in1.y];
1624				out0 = vec3(x, y, z);
1625				${OUTPUT}
1626			}
1627		""
1628	end
1629
1630	case multiple_declarations_single_statement_explicit
1631		version 300 es
1632		values
1633		{
1634			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1635			output vec3 out0 = [ vec3(2.0, -1.0, 0.5) ];
1636		}
1637
1638		both ""
1639			#version 300 es
1640			precision mediump float;
1641			${DECLARATIONS}
1642
1643			void main ()
1644			{
1645				${SETUP}
1646				float[] x = float[6] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
1647						y = float[2] (in0.x, -in0.y);
1648				out0 = vec3(x[2], y[1], x[0]);
1649				${OUTPUT}
1650			}
1651		""
1652	end
1653
1654	case multiple_declarations_single_statement_implicit
1655		version 300 es
1656		values
1657		{
1658			input ivec3 in0 = [ ivec3(5, 1, 2) ];
1659			output ivec3 out0 = [ ivec3(2, -1, 5) ];
1660		}
1661
1662		both ""
1663			#version 300 es
1664			precision mediump float;
1665			${DECLARATIONS}
1666
1667			void main ()
1668			{
1669				${SETUP}
1670				int[] x = int[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
1671					  y = int[] (in0.x, -in0.y);
1672				out0 = ivec3(x[2], y[1], x[0]);
1673				${OUTPUT}
1674			}
1675		""
1676	end
1677
1678end # declaration
1679
1680group length "Array length method"
1681
1682	case float
1683		version 300 es
1684		values
1685		{
1686			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1687			output ivec3 out0 = [ ivec3(3, 5, 13) ];
1688		}
1689
1690		both ""
1691			#version 300 es
1692			precision mediump float;
1693			${DECLARATIONS}
1694
1695			void main()
1696			{
1697				${SETUP}
1698				float[] x = float[3] (in0.z, in0.x, in0.y);
1699				float[] y = float[] (in0.z, in0.x, in0.y, in0.x, in0.y);
1700				float[13] z;
1701
1702				out0 = ivec3(x.length(), y.length(), z.length());
1703				${OUTPUT}
1704			}
1705		""
1706	end
1707
1708	case int
1709		version 300 es
1710		values
1711		{
1712			input ivec3 in0 = [ ivec3(0, 1, 2) ];
1713			output ivec3 out0 = [ ivec3(3, 5, 13) ];
1714		}
1715
1716		both ""
1717			#version 300 es
1718			precision mediump int;
1719			precision mediump float;
1720			${DECLARATIONS}
1721
1722			void main()
1723			{
1724				${SETUP}
1725				int[] x = int[3] (in0.z, in0.x, in0.y);
1726				int[] y = int[] (in0.z, in0.x, in0.y, in0.x, in0.y);
1727				int[13] z;
1728
1729				out0 = ivec3(x.length(), y.length(), z.length());
1730				${OUTPUT}
1731			}
1732		""
1733	end
1734
1735	case bool
1736		version 300 es
1737		values
1738		{
1739			input bvec3 in0 = [ bvec3(true, false, true) ];
1740			output ivec3 out0 = [ ivec3(3, 5, 13) ];
1741		}
1742
1743		both ""
1744			#version 300 es
1745			precision mediump float;
1746			${DECLARATIONS}
1747
1748			void main()
1749			{
1750				${SETUP}
1751				bool[] x = bool[3] (in0.z, in0.x, in0.y);
1752				bool[] y = bool[] (in0.z, in0.x, in0.y, in0.x, in0.y);
1753				bool[13] z;
1754
1755				out0 = ivec3(x.length(), y.length(), z.length());
1756				${OUTPUT}
1757			}
1758		""
1759	end
1760
1761	case struct
1762		version 300 es
1763		values
1764		{
1765			input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1766			output ivec3 out0 = [ ivec3(3, 5, 13) ];
1767		}
1768
1769		both ""
1770			#version 300 es
1771			precision mediump float;
1772			${DECLARATIONS}
1773
1774			struct test
1775			{
1776				float f;
1777				vec3 v;
1778			};
1779
1780			void main()
1781			{
1782				${SETUP}
1783
1784				test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
1785				test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
1786				test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
1787
1788				test[] x = test[3] (a, b, c);
1789				test[] y = test[] (c, a, b, b, a);
1790				test[13] z;
1791
1792				out0 = ivec3(x.length(), y.length(), z.length());
1793				${OUTPUT}
1794			}
1795		""
1796	end
1797
1798end # length
1799
1800group invalid "Invalid Functions"
1801
1802	case multidimensional_array1
1803		version 300 es
1804		expect compile_fail
1805
1806		both ""
1807			#version 300 es
1808			precision mediump float;
1809			${DECLARATIONS}
1810
1811			void main ()
1812			{
1813				float a[5][3];
1814				${POSITION_FRAG_COLOR} = vec4(1.0);
1815			}
1816		""
1817	end
1818
1819	case multidimensional_array2
1820		version 300 es
1821		expect compile_fail
1822
1823		both ""
1824			#version 300 es
1825			precision mediump float;
1826			${DECLARATIONS}
1827
1828			void main ()
1829			{
1830				float[5] a[3];
1831				${POSITION_FRAG_COLOR} = vec4(1.0);
1832			}
1833		""
1834	end
1835
1836	case multidimensional_uniform_array
1837		version 300 es
1838		expect compile_fail
1839
1840		both ""
1841			#version 300 es
1842			precision mediump float;
1843			${DECLARATIONS}
1844			uniform float a[3][2];
1845
1846			void main ()
1847			{
1848				${POSITION_FRAG_COLOR} = vec4(1.0);
1849			}
1850		""
1851	end
1852
1853	case multidimensional_array_in_uniform_block
1854		version 300 es
1855		expect compile_fail
1856
1857		both ""
1858			#version 300 es
1859			precision mediump float;
1860			${DECLARATIONS}
1861			uniform MyBlock
1862			{
1863				float a[3][2];
1864			};
1865
1866			void main ()
1867			{
1868				${POSITION_FRAG_COLOR} = vec4(1.0);
1869			}
1870		""
1871	end
1872
1873	case dynamic_expression_array_size
1874		version 300 es
1875		expect compile_fail
1876
1877		both ""
1878			#version 300 es
1879			precision mediump float;
1880			${DECLARATIONS}
1881
1882			void main ()
1883			{
1884				int a = 5;
1885				float[a] array;
1886				${POSITION_FRAG_COLOR} = vec4(1.0);
1887			}
1888		""
1889	end
1890
1891	case empty_declaration_without_var_name
1892		version 300 es
1893		expect compile_or_link_fail
1894
1895		both ""
1896			#version 300 es
1897			precision mediump float;
1898			${DECLARATIONS}
1899
1900			void main ()
1901			{
1902				int[];
1903				${POSITION_FRAG_COLOR} = vec4(1.0);
1904			}
1905		""
1906	end
1907
1908	case empty_declaration_with_var_name
1909		version 300 es
1910		expect compile_or_link_fail
1911
1912		both ""
1913			#version 300 es
1914			precision mediump float;
1915			${DECLARATIONS}
1916
1917			void main ()
1918			{
1919				int[] a;
1920				${POSITION_FRAG_COLOR} = vec4(1.0);
1921			}
1922		""
1923	end
1924
1925	case constructor_c_style1
1926		version 300 es
1927		expect compile_fail
1928
1929		both ""
1930			#version 300 es
1931			precision mediump float;
1932			${DECLARATIONS}
1933
1934			void main ()
1935			{
1936				float a[];
1937				a = float[3] { 1.0, 2.0, 3.0 };
1938
1939				${POSITION_FRAG_COLOR} = vec4(1.0);
1940			}
1941		""
1942	end
1943
1944	case constructor_c_style2
1945		version 300 es
1946		expect compile_fail
1947
1948		both ""
1949			#version 300 es
1950			precision mediump float;
1951			${DECLARATIONS}
1952
1953			void main ()
1954			{
1955				float a[5] = { 1.0, 2.0, 3.0 };
1956
1957				${POSITION_FRAG_COLOR} = vec4(1.0);
1958			}
1959		""
1960	end
1961
1962	case constructor_c_style3
1963		version 300 es
1964		expect compile_fail
1965
1966		both ""
1967			#version 300 es
1968			precision mediump float;
1969			${DECLARATIONS}
1970
1971			void main ()
1972			{
1973				float a[] = float[3] { 1.0, 2.0, 3.0 };
1974
1975				${POSITION_FRAG_COLOR} = vec4(1.0);
1976			}
1977		""
1978	end
1979
1980	case constructor_c_style4
1981		version 300 es
1982		expect compile_fail
1983
1984		both ""
1985			#version 300 es
1986			precision mediump float;
1987			${DECLARATIONS}
1988
1989			void main ()
1990			{
1991				float a[3] = { 1.0, 2.0, 3.0 };
1992
1993				${POSITION_FRAG_COLOR} = vec4(1.0);
1994			}
1995		""
1996	end
1997
1998end # invalid
1999
2000# https://github.com/KhronosGroup/WebGL/blob/master/sdk/tests/conformance2/glsl3/array-in-complex-expression.html
2001group complex_expression "Arrays in complex expressions"
2002
2003	case and_short_circuits
2004		version 300 es
2005		values
2006		{
2007			output int g = -1;
2008		}
2009
2010		both ""
2011			#version 300 es
2012			precision mediump float;
2013			${DECLARATIONS}
2014
2015			int[2] plus() {
2016				++g;
2017				return int[2](g, g);
2018			}
2019
2020			bool minus() {
2021				--g;
2022				return false;
2023			}
2024
2025			void main() {
2026				${SETUP}
2027				g = 0;
2028				int a[2] = int[2](0, 0);
2029				// The plus() call must not be evaluated, since && short-circuits
2030				minus() && (a == plus());
2031				${OUTPUT}
2032			}
2033		""
2034	end
2035
2036	case or_short_circuits
2037		version 300 es
2038		values
2039		{
2040			output int g = -1;
2041		}
2042
2043		both ""
2044			#version 300 es
2045			precision mediump float;
2046			${DECLARATIONS}
2047
2048			int[2] plus() {
2049				++g;
2050				return int[2](g, g);
2051			}
2052
2053			bool minus() {
2054				--g;
2055				return false;
2056			}
2057
2058			void main() {
2059				${SETUP}
2060				g = 0;
2061				int a[2] = int[2](0, 0);
2062				// The function call must not be evaluated, since && short-circuits
2063				minus() && (a == plus());
2064				${OUTPUT}
2065			}
2066		""
2067	end
2068
2069	case ternary_only_evaluates_one_operand
2070		version 300 es
2071		values
2072		{
2073			output int g = 0;
2074		}
2075
2076		both ""
2077			#version 300 es
2078			precision mediump float;
2079			${DECLARATIONS}
2080
2081			int[2] plus() {
2082				++g;
2083				return int[2](g, g);
2084			}
2085
2086			void main() {
2087				${SETUP}
2088				g = 0;
2089				int a[2] = int[2](0, 0);
2090				// The function call must not be evaluated, since the condition is true.
2091				(g == 0) ? true : (a == plus());
2092				${OUTPUT}
2093			}
2094		""
2095	end
2096
2097	case sequence_side_effects_affecting_compared_array_content
2098		version 300 es
2099		values
2100		{
2101			output bool success = true;
2102		}
2103
2104		both ""
2105			#version 300 es
2106			precision mediump float;
2107			${DECLARATIONS}
2108
2109			int[2] func(int param) {
2110				return int[2](param, param);
2111			}
2112
2113			void main() {
2114				${SETUP}
2115				int a[2];
2116				for (int i = 0; i < 2; ++i) {
2117					a[i] = 1;
2118				}
2119				int j = 0;
2120				// Sequence operator evaluates operands from left to right (ESSL 3.00 section 5.9).
2121				// The function call that returns the array needs to be evaluated after ++j
2122				// for the expression to return the correct value (true).
2123				success = ((++j), (a == func(j)));
2124				${OUTPUT}
2125			}
2126		""
2127	end
2128
2129end # complex_expression
2130
2131group compare "Array comparisons"
2132
2133	case equal_lowp_int_lowp_int
2134		version 300 es
2135		values
2136		{
2137			output bool success = true;
2138		}
2139
2140		both ""
2141			#version 300 es
2142			precision lowp float;
2143			${DECLARATIONS}
2144			void main()
2145			{
2146				${SETUP}
2147				lowp int x[3] = int[3](1, 2, 3);
2148				lowp int y[3] = x;
2149				x = y;
2150				success = (x == y);
2151				${OUTPUT}
2152			}
2153		""
2154	end
2155
2156	case equal_lowp_uint_lowp_uint
2157		version 300 es
2158		values
2159		{
2160			output bool success = true;
2161		}
2162
2163		both ""
2164			#version 300 es
2165			precision lowp float;
2166			${DECLARATIONS}
2167			void main()
2168			{
2169				${SETUP}
2170				lowp uint x[3] = uint[3](1u, 2u, 3u);
2171				lowp uint y[3] = x;
2172				x = y;
2173				success = (x == y);
2174				${OUTPUT}
2175			}
2176		""
2177	end
2178
2179	case equal_lowp_float_lowp_float
2180		version 300 es
2181		values
2182		{
2183			output bool success = true;
2184		}
2185
2186		both ""
2187			#version 300 es
2188			precision lowp float;
2189			${DECLARATIONS}
2190			void main()
2191			{
2192				${SETUP}
2193				lowp float x[3] = float[3](1.0, 2.0, 3.0);
2194				lowp float y[3] = x;
2195				x = y;
2196				success = (x == y);
2197				${OUTPUT}
2198			}
2199		""
2200	end
2201
2202	case equal_lowp_vec2_lowp_vec2
2203		version 300 es
2204		values
2205		{
2206			output bool success = true;
2207		}
2208
2209		both ""
2210			#version 300 es
2211			precision lowp float;
2212			${DECLARATIONS}
2213			void main()
2214			{
2215				${SETUP}
2216				lowp vec2 x[3] = vec2[3](vec2(1.0, 2.0),
2217										 vec2(3.0, 4.0),
2218										 vec2(5.0, 6.0));
2219				lowp vec2 y[3] = x;
2220				x = y;
2221				success = (x == y);
2222				${OUTPUT}
2223			}
2224		""
2225	end
2226
2227	case equal_lowp_vec3_lowp_vec3
2228		version 300 es
2229		values
2230		{
2231			output bool success = true;
2232		}
2233
2234		both ""
2235			#version 300 es
2236			precision lowp float;
2237			${DECLARATIONS}
2238			void main()
2239			{
2240				${SETUP}
2241				lowp vec3 x[3] = vec3[3](vec3(1.0, 2.0, 3.0),
2242										 vec3(4.0, 5.0, 6.0),
2243										 vec3(7.0, 8.0, 9.0));
2244				lowp vec3 y[3] = x;
2245				x = y;
2246				success = (x == y);
2247				${OUTPUT}
2248			}
2249		""
2250	end
2251
2252	case equal_lowp_vec4_lowp_vec4
2253		version 300 es
2254		values
2255		{
2256			output bool success = true;
2257		}
2258
2259		both ""
2260			#version 300 es
2261			precision lowp float;
2262			${DECLARATIONS}
2263			void main()
2264			{
2265				${SETUP}
2266				lowp vec4 x[3] = vec4[3](vec4(1.0, 2.0, 3.0, 4.0),
2267										 vec4(5.0, 6.0, 7.0, 8.0),
2268										 vec4(9.0, 10.0, 11.0, 12.0));
2269				lowp vec4 y[3] = x;
2270				x = y;
2271				success = (x == y);
2272				${OUTPUT}
2273			}
2274		""
2275	end
2276
2277	case equal_lowp_ivec2_lowp_ivec2
2278		version 300 es
2279		values
2280		{
2281			output bool success = true;
2282		}
2283
2284		both ""
2285			#version 300 es
2286			precision lowp float;
2287			${DECLARATIONS}
2288			void main()
2289			{
2290				${SETUP}
2291				lowp ivec2 x[3] = ivec2[3](ivec2(1, 2),
2292										   ivec2(3, 4),
2293										   ivec2(5, 6));
2294				lowp ivec2 y[3] = x;
2295				x = y;
2296				success = (x == y);
2297				${OUTPUT}
2298			}
2299		""
2300	end
2301
2302	case equal_lowp_ivec3_lowp_ivec3
2303		version 300 es
2304		values
2305		{
2306			output bool success = true;
2307		}
2308
2309		both ""
2310			#version 300 es
2311			precision lowp float;
2312			${DECLARATIONS}
2313			void main()
2314			{
2315				${SETUP}
2316				lowp ivec3 x[3] = ivec3[3](ivec3(1, 2, 3),
2317										   ivec3(4, 5, 6),
2318										   ivec3(7, 8, 9));
2319				lowp ivec3 y[3] = x;
2320				x = y;
2321				success = (x == y);
2322				${OUTPUT}
2323			}
2324		""
2325	end
2326
2327	case equal_lowp_ivec4_lowp_ivec4
2328		version 300 es
2329		values
2330		{
2331			output bool success = true;
2332		}
2333
2334		both ""
2335			#version 300 es
2336			precision lowp float;
2337			${DECLARATIONS}
2338			void main()
2339			{
2340				${SETUP}
2341				lowp ivec4 x[3] = ivec4[3](ivec4(1, 2, 3, 4),
2342										   ivec4(5, 6, 7, 8),
2343										   ivec4(9, 10, 11, 12));
2344				lowp ivec4 y[3] = x;
2345				x = y;
2346				success = (x == y);
2347				${OUTPUT}
2348			}
2349		""
2350	end
2351
2352	case equal_lowp_uvec2_lowp_uvec2
2353		version 300 es
2354		values
2355		{
2356			output bool success = true;
2357		}
2358
2359		both ""
2360			#version 300 es
2361			precision lowp float;
2362			${DECLARATIONS}
2363			void main()
2364			{
2365				${SETUP}
2366				lowp uvec2 x[3] = uvec2[3](uvec2(1u, 2u),
2367										   uvec2(3u, 4u),
2368										   uvec2(5u, 6u));
2369				lowp uvec2 y[3] = x;
2370				x = y;
2371				success = (x == y);
2372				${OUTPUT}
2373			}
2374		""
2375	end
2376
2377	case equal_lowp_uvec3_lowp_uvec3
2378		version 300 es
2379		values
2380		{
2381			output bool success = true;
2382		}
2383
2384		both ""
2385			#version 300 es
2386			precision lowp float;
2387			${DECLARATIONS}
2388			void main()
2389			{
2390				${SETUP}
2391				lowp uvec3 x[3] = uvec3[3](uvec3(1u, 2u, 3u),
2392										   uvec3(4u, 5u, 6u),
2393										   uvec3(7u, 8u, 9u));
2394				lowp uvec3 y[3] = x;
2395				x = y;
2396				success = (x == y);
2397				${OUTPUT}
2398			}
2399		""
2400	end
2401
2402	case equal_lowp_uvec4_lowp_uvec4
2403		version 300 es
2404		values
2405		{
2406			output bool success = true;
2407		}
2408
2409		both ""
2410			#version 300 es
2411			precision lowp float;
2412			${DECLARATIONS}
2413			void main()
2414			{
2415				${SETUP}
2416				lowp uvec4 x[3] = uvec4[3](uvec4(1u, 2u, 3u, 4u),
2417										   uvec4(5u, 6u, 7u, 8u),
2418										   uvec4(9u, 10u, 11u, 12u));
2419				lowp uvec4 y[3] = x;
2420				x = y;
2421				success = (x == y);
2422				${OUTPUT}
2423			}
2424		""
2425	end
2426
2427	case equal_lowp_mat2_lowp_mat2
2428		version 300 es
2429		values
2430		{
2431			output bool success = true;
2432		}
2433
2434		both ""
2435			#version 300 es
2436			precision lowp float;
2437			${DECLARATIONS}
2438			void main()
2439			{
2440				${SETUP}
2441				lowp mat2 x[3] = mat2[3](mat2(1.0, 2.0, 3.0, 4.0),
2442										 mat2(5.0, 6.0, 7.0, 8.0),
2443										 mat2(9.0, 10.0, 11.0, 12.0));
2444				lowp mat2 y[3] = x;
2445				x = y;
2446				success = (x == y);
2447				${OUTPUT}
2448			}
2449		""
2450	end
2451
2452	case equal_lowp_mat3_lowp_mat3
2453		version 300 es
2454		values
2455		{
2456			output bool success = true;
2457		}
2458
2459		both ""
2460			#version 300 es
2461			precision lowp float;
2462			${DECLARATIONS}
2463			void main()
2464			{
2465				${SETUP}
2466				lowp mat3 x[3] = mat3[3](mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0),
2467										 mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0),
2468										 mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0));
2469				lowp mat3 y[3] = x;
2470				x = y;
2471				success = (x == y);
2472				${OUTPUT}
2473			}
2474		""
2475	end
2476
2477	case equal_lowp_mat4_lowp_mat4
2478		version 300 es
2479		values
2480		{
2481			output bool success = true;
2482		}
2483
2484		both ""
2485			#version 300 es
2486			precision lowp float;
2487			${DECLARATIONS}
2488			void main()
2489			{
2490				${SETUP}
2491				lowp mat4 x[3] = mat4[3](mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0),
2492										 mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0),
2493										 mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0));
2494				lowp mat4 y[3] = x;
2495				x = y;
2496				success = (x == y);
2497				${OUTPUT}
2498			}
2499		""
2500	end
2501
2502	case equal_mediump_int_lowp_int
2503		version 300 es
2504		values
2505		{
2506			output bool success = true;
2507		}
2508
2509		both ""
2510			#version 300 es
2511			precision mediump float;
2512			${DECLARATIONS}
2513			void main()
2514			{
2515				${SETUP}
2516				mediump int x[3] = int[3](1, 2, 3);
2517				lowp int y[3] = x;
2518				x = y;
2519				success = (x == y);
2520				${OUTPUT}
2521			}
2522		""
2523	end
2524
2525	case equal_mediump_uint_lowp_uint
2526		version 300 es
2527		values
2528		{
2529			output bool success = true;
2530		}
2531
2532		both ""
2533			#version 300 es
2534			precision mediump float;
2535			${DECLARATIONS}
2536			void main()
2537			{
2538				${SETUP}
2539				mediump uint x[3] = uint[3](1u, 2u, 3u);
2540				lowp uint y[3] = x;
2541				x = y;
2542				success = (x == y);
2543				${OUTPUT}
2544			}
2545		""
2546	end
2547
2548	case equal_mediump_float_lowp_float
2549		version 300 es
2550		values
2551		{
2552			output bool success = true;
2553		}
2554
2555		both ""
2556			#version 300 es
2557			precision mediump float;
2558			${DECLARATIONS}
2559			void main()
2560			{
2561				${SETUP}
2562				mediump float x[3] = float[3](1.0, 2.0, 3.0);
2563				lowp float y[3] = x;
2564				x = y;
2565				success = (x == y);
2566				${OUTPUT}
2567			}
2568		""
2569	end
2570
2571	case equal_mediump_vec2_lowp_vec2
2572		version 300 es
2573		values
2574		{
2575			output bool success = true;
2576		}
2577
2578		both ""
2579			#version 300 es
2580			precision mediump float;
2581			${DECLARATIONS}
2582			void main()
2583			{
2584				${SETUP}
2585				mediump vec2 x[3] = vec2[3](vec2(1.0, 2.0),
2586											vec2(3.0, 4.0),
2587											vec2(5.0, 6.0));
2588				lowp vec2 y[3] = x;
2589				x = y;
2590				success = (x == y);
2591				${OUTPUT}
2592			}
2593		""
2594	end
2595
2596	case equal_mediump_vec3_lowp_vec3
2597		version 300 es
2598		values
2599		{
2600			output bool success = true;
2601		}
2602
2603		both ""
2604			#version 300 es
2605			precision mediump float;
2606			${DECLARATIONS}
2607			void main()
2608			{
2609				${SETUP}
2610				mediump vec3 x[3] = vec3[3](vec3(1.0, 2.0, 3.0),
2611											vec3(4.0, 5.0, 6.0),
2612											vec3(7.0, 8.0, 9.0));
2613				lowp vec3 y[3] = x;
2614				x = y;
2615				success = (x == y);
2616				${OUTPUT}
2617			}
2618		""
2619	end
2620
2621	case equal_mediump_vec4_lowp_vec4
2622		version 300 es
2623		values
2624		{
2625			output bool success = true;
2626		}
2627
2628		both ""
2629			#version 300 es
2630			precision mediump float;
2631			${DECLARATIONS}
2632			void main()
2633			{
2634				${SETUP}
2635				mediump vec4 x[3] = vec4[3](vec4(1.0, 2.0, 3.0, 4.0),
2636											vec4(5.0, 6.0, 7.0, 8.0),
2637											vec4(9.0, 10.0, 11.0, 12.0));
2638				lowp vec4 y[3] = x;
2639				x = y;
2640				success = (x == y);
2641				${OUTPUT}
2642			}
2643		""
2644	end
2645
2646	case equal_mediump_ivec2_lowp_ivec2
2647		version 300 es
2648		values
2649		{
2650			output bool success = true;
2651		}
2652
2653		both ""
2654			#version 300 es
2655			precision mediump float;
2656			${DECLARATIONS}
2657			void main()
2658			{
2659				${SETUP}
2660				mediump ivec2 x[3] = ivec2[3](ivec2(1, 2),
2661											  ivec2(3, 4),
2662											  ivec2(5, 6));
2663				lowp ivec2 y[3] = x;
2664				x = y;
2665				success = (x == y);
2666				${OUTPUT}
2667			}
2668		""
2669	end
2670
2671	case equal_mediump_ivec3_lowp_ivec3
2672		version 300 es
2673		values
2674		{
2675			output bool success = true;
2676		}
2677
2678		both ""
2679			#version 300 es
2680			precision mediump float;
2681			${DECLARATIONS}
2682			void main()
2683			{
2684				${SETUP}
2685				mediump ivec3 x[3] = ivec3[3](ivec3(1, 2, 3),
2686											  ivec3(4, 5, 6),
2687											  ivec3(7, 8, 9));
2688				lowp ivec3 y[3] = x;
2689				x = y;
2690				success = (x == y);
2691				${OUTPUT}
2692			}
2693		""
2694	end
2695
2696	case equal_mediump_ivec4_lowp_ivec4
2697		version 300 es
2698		values
2699		{
2700			output bool success = true;
2701		}
2702
2703		both ""
2704			#version 300 es
2705			precision mediump float;
2706			${DECLARATIONS}
2707			void main()
2708			{
2709				${SETUP}
2710				mediump ivec4 x[3] = ivec4[3](ivec4(1, 2, 3, 4),
2711											  ivec4(5, 6, 7, 8),
2712											  ivec4(9, 10, 11, 12));
2713				lowp ivec4 y[3] = x;
2714				x = y;
2715				success = (x == y);
2716				${OUTPUT}
2717			}
2718		""
2719	end
2720
2721	case equal_mediump_uvec2_lowp_uvec2
2722		version 300 es
2723		values
2724		{
2725			output bool success = true;
2726		}
2727
2728		both ""
2729			#version 300 es
2730			precision mediump float;
2731			${DECLARATIONS}
2732			void main()
2733			{
2734				${SETUP}
2735				mediump uvec2 x[3] = uvec2[3](uvec2(1u, 2u),
2736											  uvec2(3u, 4u),
2737											  uvec2(5u, 6u));
2738				lowp uvec2 y[3] = x;
2739				x = y;
2740				success = (x == y);
2741				${OUTPUT}
2742			}
2743		""
2744	end
2745
2746	case equal_mediump_uvec3_lowp_uvec3
2747		version 300 es
2748		values
2749		{
2750			output bool success = true;
2751		}
2752
2753		both ""
2754			#version 300 es
2755			precision mediump float;
2756			${DECLARATIONS}
2757			void main()
2758			{
2759				${SETUP}
2760				mediump uvec3 x[3] = uvec3[3](uvec3(1u, 2u, 3u),
2761											  uvec3(4u, 5u, 6u),
2762											  uvec3(7u, 8u, 9u));
2763				lowp uvec3 y[3] = x;
2764				x = y;
2765				success = (x == y);
2766				${OUTPUT}
2767			}
2768		""
2769	end
2770
2771	case equal_mediump_uvec4_lowp_uvec4
2772		version 300 es
2773		values
2774		{
2775			output bool success = true;
2776		}
2777
2778		both ""
2779			#version 300 es
2780			precision mediump float;
2781			${DECLARATIONS}
2782			void main()
2783			{
2784				${SETUP}
2785				mediump uvec4 x[3] = uvec4[3](uvec4(1u, 2u, 3u, 4u),
2786											  uvec4(5u, 6u, 7u, 8u),
2787											  uvec4(9u, 10u, 11u, 12u));
2788				lowp uvec4 y[3] = x;
2789				x = y;
2790				success = (x == y);
2791				${OUTPUT}
2792			}
2793		""
2794	end
2795
2796	case equal_mediump_mat2_lowp_mat2
2797		version 300 es
2798		values
2799		{
2800			output bool success = true;
2801		}
2802
2803		both ""
2804			#version 300 es
2805			precision mediump float;
2806			${DECLARATIONS}
2807			void main()
2808			{
2809				${SETUP}
2810				mediump mat2 x[3] = mat2[3](mat2(1.0, 2.0, 3.0, 4.0),
2811											mat2(5.0, 6.0, 7.0, 8.0),
2812											mat2(9.0, 10.0, 11.0, 12.0));
2813				lowp mat2 y[3] = x;
2814				x = y;
2815				success = (x == y);
2816				${OUTPUT}
2817			}
2818		""
2819	end
2820
2821	case equal_mediump_mat3_lowp_mat3
2822		version 300 es
2823		values
2824		{
2825			output bool success = true;
2826		}
2827
2828		both ""
2829			#version 300 es
2830			precision mediump float;
2831			${DECLARATIONS}
2832			void main()
2833			{
2834				${SETUP}
2835				mediump mat3 x[3] = mat3[3](mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0),
2836											mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0),
2837											mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0));
2838				lowp mat3 y[3] = x;
2839				x = y;
2840				success = (x == y);
2841				${OUTPUT}
2842			}
2843		""
2844	end
2845
2846	case equal_mediump_mat4_lowp_mat4
2847		version 300 es
2848		values
2849		{
2850			output bool success = true;
2851		}
2852
2853		both ""
2854			#version 300 es
2855			precision mediump float;
2856			${DECLARATIONS}
2857			void main()
2858			{
2859				${SETUP}
2860				mediump mat4 x[3] = mat4[3](mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0),
2861											mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0),
2862											mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0));
2863				lowp mat4 y[3] = x;
2864				x = y;
2865				success = (x == y);
2866				${OUTPUT}
2867			}
2868		""
2869	end
2870
2871	case equal_mediump_int_mediump_int
2872		version 300 es
2873		values
2874		{
2875			output bool success = true;
2876		}
2877
2878		both ""
2879			#version 300 es
2880			precision mediump float;
2881			${DECLARATIONS}
2882			void main()
2883			{
2884				${SETUP}
2885				mediump int x[3] = int[3](1, 2, 3);
2886				mediump int y[3] = x;
2887				x = y;
2888				success = (x == y);
2889				${OUTPUT}
2890			}
2891		""
2892	end
2893
2894	case equal_mediump_uint_mediump_uint
2895		version 300 es
2896		values
2897		{
2898			output bool success = true;
2899		}
2900
2901		both ""
2902			#version 300 es
2903			precision mediump float;
2904			${DECLARATIONS}
2905			void main()
2906			{
2907				${SETUP}
2908				mediump uint x[3] = uint[3](1u, 2u, 3u);
2909				mediump uint y[3] = x;
2910				x = y;
2911				success = (x == y);
2912				${OUTPUT}
2913			}
2914		""
2915	end
2916
2917	case equal_mediump_float_mediump_float
2918		version 300 es
2919		values
2920		{
2921			output bool success = true;
2922		}
2923
2924		both ""
2925			#version 300 es
2926			precision mediump float;
2927			${DECLARATIONS}
2928			void main()
2929			{
2930				${SETUP}
2931				mediump float x[3] = float[3](1.0, 2.0, 3.0);
2932				mediump float y[3] = x;
2933				x = y;
2934				success = (x == y);
2935				${OUTPUT}
2936			}
2937		""
2938	end
2939
2940	case equal_mediump_vec2_mediump_vec2
2941		version 300 es
2942		values
2943		{
2944			output bool success = true;
2945		}
2946
2947		both ""
2948			#version 300 es
2949			precision mediump float;
2950			${DECLARATIONS}
2951			void main()
2952			{
2953				${SETUP}
2954				mediump vec2 x[3] = vec2[3](vec2(1.0, 2.0),
2955											vec2(3.0, 4.0),
2956											vec2(5.0, 6.0));
2957				mediump vec2 y[3] = x;
2958				x = y;
2959				success = (x == y);
2960				${OUTPUT}
2961			}
2962		""
2963	end
2964
2965	case equal_mediump_vec3_mediump_vec3
2966		version 300 es
2967		values
2968		{
2969			output bool success = true;
2970		}
2971
2972		both ""
2973			#version 300 es
2974			precision mediump float;
2975			${DECLARATIONS}
2976			void main()
2977			{
2978				${SETUP}
2979				mediump vec3 x[3] = vec3[3](vec3(1.0, 2.0, 3.0),
2980											vec3(4.0, 5.0, 6.0),
2981											vec3(7.0, 8.0, 9.0));
2982				mediump vec3 y[3] = x;
2983				x = y;
2984				success = (x == y);
2985				${OUTPUT}
2986			}
2987		""
2988	end
2989
2990	case equal_mediump_vec4_mediump_vec4
2991		version 300 es
2992		values
2993		{
2994			output bool success = true;
2995		}
2996
2997		both ""
2998			#version 300 es
2999			precision mediump float;
3000			${DECLARATIONS}
3001			void main()
3002			{
3003				${SETUP}
3004				mediump vec4 x[3] = vec4[3](vec4(1.0, 2.0, 3.0, 4.0),
3005											vec4(5.0, 6.0, 7.0, 8.0),
3006											vec4(9.0, 10.0, 11.0, 12.0));
3007				mediump vec4 y[3] = x;
3008				x = y;
3009				success = (x == y);
3010				${OUTPUT}
3011			}
3012		""
3013	end
3014
3015	case equal_mediump_ivec2_mediump_ivec2
3016		version 300 es
3017		values
3018		{
3019			output bool success = true;
3020		}
3021
3022		both ""
3023			#version 300 es
3024			precision mediump float;
3025			${DECLARATIONS}
3026			void main()
3027			{
3028				${SETUP}
3029				mediump ivec2 x[3] = ivec2[3](ivec2(1, 2),
3030											  ivec2(3, 4),
3031											  ivec2(5, 6));
3032				mediump ivec2 y[3] = x;
3033				x = y;
3034				success = (x == y);
3035				${OUTPUT}
3036			}
3037		""
3038	end
3039
3040	case equal_mediump_ivec3_mediump_ivec3
3041		version 300 es
3042		values
3043		{
3044			output bool success = true;
3045		}
3046
3047		both ""
3048			#version 300 es
3049			precision mediump float;
3050			${DECLARATIONS}
3051			void main()
3052			{
3053				${SETUP}
3054				mediump ivec3 x[3] = ivec3[3](ivec3(1, 2, 3),
3055											  ivec3(4, 5, 6),
3056											  ivec3(7, 8, 9));
3057				mediump ivec3 y[3] = x;
3058				x = y;
3059				success = (x == y);
3060				${OUTPUT}
3061			}
3062		""
3063	end
3064
3065	case equal_mediump_ivec4_mediump_ivec4
3066		version 300 es
3067		values
3068		{
3069			output bool success = true;
3070		}
3071
3072		both ""
3073			#version 300 es
3074			precision mediump float;
3075			${DECLARATIONS}
3076			void main()
3077			{
3078				${SETUP}
3079				mediump ivec4 x[3] = ivec4[3](ivec4(1, 2, 3, 4),
3080											  ivec4(5, 6, 7, 8),
3081											  ivec4(9, 10, 11, 12));
3082				mediump ivec4 y[3] = x;
3083				x = y;
3084				success = (x == y);
3085				${OUTPUT}
3086			}
3087		""
3088	end
3089
3090	case equal_mediump_uvec2_mediump_uvec2
3091		version 300 es
3092		values
3093		{
3094			output bool success = true;
3095		}
3096
3097		both ""
3098			#version 300 es
3099			precision mediump float;
3100			${DECLARATIONS}
3101			void main()
3102			{
3103				${SETUP}
3104				mediump uvec2 x[3] = uvec2[3](uvec2(1u, 2u),
3105											  uvec2(3u, 4u),
3106											  uvec2(5u, 6u));
3107				mediump uvec2 y[3] = x;
3108				x = y;
3109				success = (x == y);
3110				${OUTPUT}
3111			}
3112		""
3113	end
3114
3115	case equal_mediump_uvec3_mediump_uvec3
3116		version 300 es
3117		values
3118		{
3119			output bool success = true;
3120		}
3121
3122		both ""
3123			#version 300 es
3124			precision mediump float;
3125			${DECLARATIONS}
3126			void main()
3127			{
3128				${SETUP}
3129				mediump uvec3 x[3] = uvec3[3](uvec3(1u, 2u, 3u),
3130											  uvec3(4u, 5u, 6u),
3131											  uvec3(7u, 8u, 9u));
3132				mediump uvec3 y[3] = x;
3133				x = y;
3134				success = (x == y);
3135				${OUTPUT}
3136			}
3137		""
3138	end
3139
3140	case equal_mediump_uvec4_mediump_uvec4
3141		version 300 es
3142		values
3143		{
3144			output bool success = true;
3145		}
3146
3147		both ""
3148			#version 300 es
3149			precision mediump float;
3150			${DECLARATIONS}
3151			void main()
3152			{
3153				${SETUP}
3154				mediump uvec4 x[3] = uvec4[3](uvec4(1u, 2u, 3u, 4u),
3155											  uvec4(5u, 6u, 7u, 8u),
3156											  uvec4(9u, 10u, 11u, 12u));
3157				mediump uvec4 y[3] = x;
3158				x = y;
3159				success = (x == y);
3160				${OUTPUT}
3161			}
3162		""
3163	end
3164
3165	case equal_mediump_mat2_mediump_mat2
3166		version 300 es
3167		values
3168		{
3169			output bool success = true;
3170		}
3171
3172		both ""
3173			#version 300 es
3174			precision mediump float;
3175			${DECLARATIONS}
3176			void main()
3177			{
3178				${SETUP}
3179				mediump mat2 x[3] = mat2[3](mat2(1.0, 2.0, 3.0, 4.0),
3180											mat2(5.0, 6.0, 7.0, 8.0),
3181											mat2(9.0, 10.0, 11.0, 12.0));
3182				mediump mat2 y[3] = x;
3183				x = y;
3184				success = (x == y);
3185				${OUTPUT}
3186			}
3187		""
3188	end
3189
3190	case equal_mediump_mat3_mediump_mat3
3191		version 300 es
3192		values
3193		{
3194			output bool success = true;
3195		}
3196
3197		both ""
3198			#version 300 es
3199			precision mediump float;
3200			${DECLARATIONS}
3201			void main()
3202			{
3203				${SETUP}
3204				mediump mat3 x[3] = mat3[3](mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0),
3205											mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0),
3206											mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0));
3207				mediump mat3 y[3] = x;
3208				x = y;
3209				success = (x == y);
3210				${OUTPUT}
3211			}
3212		""
3213	end
3214
3215	case equal_mediump_mat4_mediump_mat4
3216		version 300 es
3217		values
3218		{
3219			output bool success = true;
3220		}
3221
3222		both ""
3223			#version 300 es
3224			precision mediump float;
3225			${DECLARATIONS}
3226			void main()
3227			{
3228				${SETUP}
3229				mediump mat4 x[3] = mat4[3](mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0),
3230											mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0),
3231											mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0));
3232				mediump mat4 y[3] = x;
3233				x = y;
3234				success = (x == y);
3235				${OUTPUT}
3236			}
3237		""
3238	end
3239
3240	case equal_highp_int_mediump_int
3241		version 300 es
3242		values
3243		{
3244			output bool success = true;
3245		}
3246
3247		both ""
3248			#version 300 es
3249			precision highp float;
3250			${DECLARATIONS}
3251			void main()
3252			{
3253				${SETUP}
3254				highp int x[3] = int[3](1, 2, 3);
3255				mediump int y[3] = x;
3256				x = y;
3257				success = (x == y);
3258				${OUTPUT}
3259			}
3260		""
3261	end
3262
3263	case equal_highp_uint_mediump_uint
3264		version 300 es
3265		values
3266		{
3267			output bool success = true;
3268		}
3269
3270		both ""
3271			#version 300 es
3272			precision highp float;
3273			${DECLARATIONS}
3274			void main()
3275			{
3276				${SETUP}
3277				highp uint x[3] = uint[3](1u, 2u, 3u);
3278				mediump uint y[3] = x;
3279				x = y;
3280				success = (x == y);
3281				${OUTPUT}
3282			}
3283		""
3284	end
3285
3286	case equal_highp_float_mediump_float
3287		version 300 es
3288		values
3289		{
3290			output bool success = true;
3291		}
3292
3293		both ""
3294			#version 300 es
3295			precision highp float;
3296			${DECLARATIONS}
3297			void main()
3298			{
3299				${SETUP}
3300				highp float x[3] = float[3](1.0, 2.0, 3.0);
3301				mediump float y[3] = x;
3302				x = y;
3303				success = (x == y);
3304				${OUTPUT}
3305			}
3306		""
3307	end
3308
3309	case equal_highp_vec2_mediump_vec2
3310		version 300 es
3311		values
3312		{
3313			output bool success = true;
3314		}
3315
3316		both ""
3317			#version 300 es
3318			precision highp float;
3319			${DECLARATIONS}
3320			void main()
3321			{
3322				${SETUP}
3323				highp vec2 x[3] = vec2[3](vec2(1.0, 2.0),
3324										  vec2(3.0, 4.0),
3325										  vec2(5.0, 6.0));
3326				mediump vec2 y[3] = x;
3327				x = y;
3328				success = (x == y);
3329				${OUTPUT}
3330			}
3331		""
3332	end
3333
3334	case equal_highp_vec3_mediump_vec3
3335		version 300 es
3336		values
3337		{
3338			output bool success = true;
3339		}
3340
3341		both ""
3342			#version 300 es
3343			precision highp float;
3344			${DECLARATIONS}
3345			void main()
3346			{
3347				${SETUP}
3348				highp vec3 x[3] = vec3[3](vec3(1.0, 2.0, 3.0),
3349										  vec3(4.0, 5.0, 6.0),
3350										  vec3(7.0, 8.0, 9.0));
3351				mediump vec3 y[3] = x;
3352				x = y;
3353				success = (x == y);
3354				${OUTPUT}
3355			}
3356		""
3357	end
3358
3359	case equal_highp_vec4_mediump_vec4
3360		version 300 es
3361		values
3362		{
3363			output bool success = true;
3364		}
3365
3366		both ""
3367			#version 300 es
3368			precision highp float;
3369			${DECLARATIONS}
3370			void main()
3371			{
3372				${SETUP}
3373				highp vec4 x[3] = vec4[3](vec4(1.0, 2.0, 3.0, 4.0),
3374										  vec4(5.0, 6.0, 7.0, 8.0),
3375										  vec4(9.0, 10.0, 11.0, 12.0));
3376				mediump vec4 y[3] = x;
3377				x = y;
3378				success = (x == y);
3379				${OUTPUT}
3380			}
3381		""
3382	end
3383
3384	case equal_highp_ivec2_mediump_ivec2
3385		version 300 es
3386		values
3387		{
3388			output bool success = true;
3389		}
3390
3391		both ""
3392			#version 300 es
3393			precision highp float;
3394			${DECLARATIONS}
3395			void main()
3396			{
3397				${SETUP}
3398				highp ivec2 x[3] = ivec2[3](ivec2(1, 2),
3399											ivec2(3, 4),
3400											ivec2(5, 6));
3401				mediump ivec2 y[3] = x;
3402				x = y;
3403				success = (x == y);
3404				${OUTPUT}
3405			}
3406		""
3407	end
3408
3409	case equal_highp_ivec3_mediump_ivec3
3410		version 300 es
3411		values
3412		{
3413			output bool success = true;
3414		}
3415
3416		both ""
3417			#version 300 es
3418			precision highp float;
3419			${DECLARATIONS}
3420			void main()
3421			{
3422				${SETUP}
3423				highp ivec3 x[3] = ivec3[3](ivec3(1, 2, 3),
3424											ivec3(4, 5, 6),
3425											ivec3(7, 8, 9));
3426				mediump ivec3 y[3] = x;
3427				x = y;
3428				success = (x == y);
3429				${OUTPUT}
3430			}
3431		""
3432	end
3433
3434	case equal_highp_ivec4_mediump_ivec4
3435		version 300 es
3436		values
3437		{
3438			output bool success = true;
3439		}
3440
3441		both ""
3442			#version 300 es
3443			precision highp float;
3444			${DECLARATIONS}
3445			void main()
3446			{
3447				${SETUP}
3448				highp ivec4 x[3] = ivec4[3](ivec4(1, 2, 3, 4),
3449											ivec4(5, 6, 7, 8),
3450											ivec4(9, 10, 11, 12));
3451				mediump ivec4 y[3] = x;
3452				x = y;
3453				success = (x == y);
3454				${OUTPUT}
3455			}
3456		""
3457	end
3458
3459	case equal_highp_uvec2_mediump_uvec2
3460		version 300 es
3461		values
3462		{
3463			output bool success = true;
3464		}
3465
3466		both ""
3467			#version 300 es
3468			precision highp float;
3469			${DECLARATIONS}
3470			void main()
3471			{
3472				${SETUP}
3473				highp uvec2 x[3] = uvec2[3](uvec2(1u, 2u),
3474											uvec2(3u, 4u),
3475											uvec2(5u, 6u));
3476				mediump uvec2 y[3] = x;
3477				x = y;
3478				success = (x == y);
3479				${OUTPUT}
3480			}
3481		""
3482	end
3483
3484	case equal_highp_uvec3_mediump_uvec3
3485		version 300 es
3486		values
3487		{
3488			output bool success = true;
3489		}
3490
3491		both ""
3492			#version 300 es
3493			precision highp float;
3494			${DECLARATIONS}
3495			void main()
3496			{
3497				${SETUP}
3498				highp uvec3 x[3] = uvec3[3](uvec3(1u, 2u, 3u),
3499											uvec3(4u, 5u, 6u),
3500											uvec3(7u, 8u, 9u));
3501				mediump uvec3 y[3] = x;
3502				x = y;
3503				success = (x == y);
3504				${OUTPUT}
3505			}
3506		""
3507	end
3508
3509	case equal_highp_uvec4_mediump_uvec4
3510		version 300 es
3511		values
3512		{
3513			output bool success = true;
3514		}
3515
3516		both ""
3517			#version 300 es
3518			precision highp float;
3519			${DECLARATIONS}
3520			void main()
3521			{
3522				${SETUP}
3523				highp uvec4 x[3] = uvec4[3](uvec4(1u, 2u, 3u, 4u),
3524											uvec4(5u, 6u, 7u, 8u),
3525											uvec4(9u, 10u, 11u, 12u));
3526				mediump uvec4 y[3] = x;
3527				x = y;
3528				success = (x == y);
3529				${OUTPUT}
3530			}
3531		""
3532	end
3533
3534	case equal_highp_mat2_mediump_mat2
3535		version 300 es
3536		values
3537		{
3538			output bool success = true;
3539		}
3540
3541		both ""
3542			#version 300 es
3543			precision highp float;
3544			${DECLARATIONS}
3545			void main()
3546			{
3547				${SETUP}
3548				highp mat2 x[3] = mat2[3](mat2(1.0, 2.0, 3.0, 4.0),
3549										  mat2(5.0, 6.0, 7.0, 8.0),
3550										  mat2(9.0, 10.0, 11.0, 12.0));
3551				mediump mat2 y[3] = x;
3552				x = y;
3553				success = (x == y);
3554				${OUTPUT}
3555			}
3556		""
3557	end
3558
3559	case equal_highp_mat3_mediump_mat3
3560		version 300 es
3561		values
3562		{
3563			output bool success = true;
3564		}
3565
3566		both ""
3567			#version 300 es
3568			precision highp float;
3569			${DECLARATIONS}
3570			void main()
3571			{
3572				${SETUP}
3573				highp mat3 x[3] = mat3[3](mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0),
3574										  mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0),
3575										  mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0));
3576				mediump mat3 y[3] = x;
3577				x = y;
3578				success = (x == y);
3579				${OUTPUT}
3580			}
3581		""
3582	end
3583
3584	case equal_highp_mat4_mediump_mat4
3585		version 300 es
3586		values
3587		{
3588			output bool success = true;
3589		}
3590
3591		both ""
3592			#version 300 es
3593			precision highp float;
3594			${DECLARATIONS}
3595			void main()
3596			{
3597				${SETUP}
3598				highp mat4 x[3] = mat4[3](mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0),
3599										  mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0),
3600										  mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0));
3601				mediump mat4 y[3] = x;
3602				x = y;
3603				success = (x == y);
3604				${OUTPUT}
3605			}
3606		""
3607	end
3608
3609	case equal_highp_int_lowp_int
3610		version 300 es
3611		values
3612		{
3613			output bool success = true;
3614		}
3615
3616		both ""
3617			#version 300 es
3618			precision highp float;
3619			${DECLARATIONS}
3620			void main()
3621			{
3622				${SETUP}
3623				highp int x[3] = int[3](1, 2, 3);
3624				lowp int y[3] = x;
3625				x = y;
3626				success = (x == y);
3627				${OUTPUT}
3628			}
3629		""
3630	end
3631
3632	case equal_highp_uint_lowp_uint
3633		version 300 es
3634		values
3635		{
3636			output bool success = true;
3637		}
3638
3639		both ""
3640			#version 300 es
3641			precision highp float;
3642			${DECLARATIONS}
3643			void main()
3644			{
3645				${SETUP}
3646				highp uint x[3] = uint[3](1u, 2u, 3u);
3647				lowp uint y[3] = x;
3648				x = y;
3649				success = (x == y);
3650				${OUTPUT}
3651			}
3652		""
3653	end
3654
3655	case equal_highp_float_lowp_float
3656		version 300 es
3657		values
3658		{
3659			output bool success = true;
3660		}
3661
3662		both ""
3663			#version 300 es
3664			precision highp float;
3665			${DECLARATIONS}
3666			void main()
3667			{
3668				${SETUP}
3669				highp float x[3] = float[3](1.0, 2.0, 3.0);
3670				lowp float y[3] = x;
3671				x = y;
3672				success = (x == y);
3673				${OUTPUT}
3674			}
3675		""
3676	end
3677
3678	case equal_highp_vec2_lowp_vec2
3679		version 300 es
3680		values
3681		{
3682			output bool success = true;
3683		}
3684
3685		both ""
3686			#version 300 es
3687			precision highp float;
3688			${DECLARATIONS}
3689			void main()
3690			{
3691				${SETUP}
3692				highp vec2 x[3] = vec2[3](vec2(1.0, 2.0),
3693										  vec2(3.0, 4.0),
3694										  vec2(5.0, 6.0));
3695				lowp vec2 y[3] = x;
3696				x = y;
3697				success = (x == y);
3698				${OUTPUT}
3699			}
3700		""
3701	end
3702
3703	case equal_highp_vec3_lowp_vec3
3704		version 300 es
3705		values
3706		{
3707			output bool success = true;
3708		}
3709
3710		both ""
3711			#version 300 es
3712			precision highp float;
3713			${DECLARATIONS}
3714			void main()
3715			{
3716				${SETUP}
3717				highp vec3 x[3] = vec3[3](vec3(1.0, 2.0, 3.0),
3718										  vec3(4.0, 5.0, 6.0),
3719										  vec3(7.0, 8.0, 9.0));
3720				lowp vec3 y[3] = x;
3721				x = y;
3722				success = (x == y);
3723				${OUTPUT}
3724			}
3725		""
3726	end
3727
3728	case equal_highp_vec4_lowp_vec4
3729		version 300 es
3730		values
3731		{
3732			output bool success = true;
3733		}
3734
3735		both ""
3736			#version 300 es
3737			precision highp float;
3738			${DECLARATIONS}
3739			void main()
3740			{
3741				${SETUP}
3742				highp vec4 x[3] = vec4[3](vec4(1.0, 2.0, 3.0, 4.0),
3743										  vec4(5.0, 6.0, 7.0, 8.0),
3744										  vec4(9.0, 10.0, 11.0, 12.0));
3745				lowp vec4 y[3] = x;
3746				x = y;
3747				success = (x == y);
3748				${OUTPUT}
3749			}
3750		""
3751	end
3752
3753	case equal_highp_ivec2_lowp_ivec2
3754		version 300 es
3755		values
3756		{
3757			output bool success = true;
3758		}
3759
3760		both ""
3761			#version 300 es
3762			precision highp float;
3763			${DECLARATIONS}
3764			void main()
3765			{
3766				${SETUP}
3767				highp ivec2 x[3] = ivec2[3](ivec2(1, 2),
3768											ivec2(3, 4),
3769											ivec2(5, 6));
3770				lowp ivec2 y[3] = x;
3771				x = y;
3772				success = (x == y);
3773				${OUTPUT}
3774			}
3775		""
3776	end
3777
3778	case equal_highp_ivec3_lowp_ivec3
3779		version 300 es
3780		values
3781		{
3782			output bool success = true;
3783		}
3784
3785		both ""
3786			#version 300 es
3787			precision highp float;
3788			${DECLARATIONS}
3789			void main()
3790			{
3791				${SETUP}
3792				highp ivec3 x[3] = ivec3[3](ivec3(1, 2, 3),
3793											ivec3(4, 5, 6),
3794											ivec3(7, 8, 9));
3795				lowp ivec3 y[3] = x;
3796				x = y;
3797				success = (x == y);
3798				${OUTPUT}
3799			}
3800		""
3801	end
3802
3803	case equal_highp_ivec4_lowp_ivec4
3804		version 300 es
3805		values
3806		{
3807			output bool success = true;
3808		}
3809
3810		both ""
3811			#version 300 es
3812			precision highp float;
3813			${DECLARATIONS}
3814			void main()
3815			{
3816				${SETUP}
3817				highp ivec4 x[3] = ivec4[3](ivec4(1, 2, 3, 4),
3818											ivec4(5, 6, 7, 8),
3819											ivec4(9, 10, 11, 12));
3820				lowp ivec4 y[3] = x;
3821				x = y;
3822				success = (x == y);
3823				${OUTPUT}
3824			}
3825		""
3826	end
3827
3828	case equal_highp_uvec2_lowp_uvec2
3829		version 300 es
3830		values
3831		{
3832			output bool success = true;
3833		}
3834
3835		both ""
3836			#version 300 es
3837			precision highp float;
3838			${DECLARATIONS}
3839			void main()
3840			{
3841				${SETUP}
3842				highp uvec2 x[3] = uvec2[3](uvec2(1u, 2u),
3843											uvec2(3u, 4u),
3844											uvec2(5u, 6u));
3845				lowp uvec2 y[3] = x;
3846				x = y;
3847				success = (x == y);
3848				${OUTPUT}
3849			}
3850		""
3851	end
3852
3853	case equal_highp_uvec3_lowp_uvec3
3854		version 300 es
3855		values
3856		{
3857			output bool success = true;
3858		}
3859
3860		both ""
3861			#version 300 es
3862			precision highp float;
3863			${DECLARATIONS}
3864			void main()
3865			{
3866				${SETUP}
3867				highp uvec3 x[3] = uvec3[3](uvec3(1u, 2u, 3u),
3868											uvec3(4u, 5u, 6u),
3869											uvec3(7u, 8u, 9u));
3870				lowp uvec3 y[3] = x;
3871				x = y;
3872				success = (x == y);
3873				${OUTPUT}
3874			}
3875		""
3876	end
3877
3878	case equal_highp_uvec4_lowp_uvec4
3879		version 300 es
3880		values
3881		{
3882			output bool success = true;
3883		}
3884
3885		both ""
3886			#version 300 es
3887			precision highp float;
3888			${DECLARATIONS}
3889			void main()
3890			{
3891				${SETUP}
3892				highp uvec4 x[3] = uvec4[3](uvec4(1u, 2u, 3u, 4u),
3893											uvec4(5u, 6u, 7u, 8u),
3894											uvec4(9u, 10u, 11u, 12u));
3895				lowp uvec4 y[3] = x;
3896				x = y;
3897				success = (x == y);
3898				${OUTPUT}
3899			}
3900		""
3901	end
3902
3903	case equal_highp_mat2_lowp_mat2
3904		version 300 es
3905		values
3906		{
3907			output bool success = true;
3908		}
3909
3910		both ""
3911			#version 300 es
3912			precision highp float;
3913			${DECLARATIONS}
3914			void main()
3915			{
3916				${SETUP}
3917				highp mat2 x[3] = mat2[3](mat2(1.0, 2.0, 3.0, 4.0),
3918										  mat2(5.0, 6.0, 7.0, 8.0),
3919										  mat2(9.0, 10.0, 11.0, 12.0));
3920				lowp mat2 y[3] = x;
3921				x = y;
3922				success = (x == y);
3923				${OUTPUT}
3924			}
3925		""
3926	end
3927
3928	case equal_highp_mat3_lowp_mat3
3929		version 300 es
3930		values
3931		{
3932			output bool success = true;
3933		}
3934
3935		both ""
3936			#version 300 es
3937			precision highp float;
3938			${DECLARATIONS}
3939			void main()
3940			{
3941				${SETUP}
3942				highp mat3 x[3] = mat3[3](mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0),
3943										  mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0),
3944										  mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0));
3945				lowp mat3 y[3] = x;
3946				x = y;
3947				success = (x == y);
3948				${OUTPUT}
3949			}
3950		""
3951	end
3952
3953	case equal_highp_mat4_lowp_mat4
3954		version 300 es
3955		values
3956		{
3957			output bool success = true;
3958		}
3959
3960		both ""
3961			#version 300 es
3962			precision highp float;
3963			${DECLARATIONS}
3964			void main()
3965			{
3966				${SETUP}
3967				highp mat4 x[3] = mat4[3](mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0),
3968										  mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0),
3969										  mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0));
3970				lowp mat4 y[3] = x;
3971				x = y;
3972				success = (x == y);
3973				${OUTPUT}
3974			}
3975		""
3976	end
3977
3978	case equal_highp_int_highp_int
3979		version 300 es
3980		values
3981		{
3982			output bool success = true;
3983		}
3984
3985		both ""
3986			#version 300 es
3987			precision highp float;
3988			${DECLARATIONS}
3989			void main()
3990			{
3991				${SETUP}
3992				highp int x[3] = int[3](1, 2, 3);
3993				highp int y[3] = x;
3994				x = y;
3995				success = (x == y);
3996				${OUTPUT}
3997			}
3998		""
3999	end
4000
4001	case equal_highp_uint_highp_uint
4002		version 300 es
4003		values
4004		{
4005			output bool success = true;
4006		}
4007
4008		both ""
4009			#version 300 es
4010			precision highp float;
4011			${DECLARATIONS}
4012			void main()
4013			{
4014				${SETUP}
4015				highp uint x[3] = uint[3](1u, 2u, 3u);
4016				highp uint y[3] = x;
4017				x = y;
4018				success = (x == y);
4019				${OUTPUT}
4020			}
4021		""
4022	end
4023
4024	case equal_highp_float_highp_float
4025		version 300 es
4026		values
4027		{
4028			output bool success = true;
4029		}
4030
4031		both ""
4032			#version 300 es
4033			precision highp float;
4034			${DECLARATIONS}
4035			void main()
4036			{
4037				${SETUP}
4038				highp float x[3] = float[3](1.0, 2.0, 3.0);
4039				highp float y[3] = x;
4040				x = y;
4041				success = (x == y);
4042				${OUTPUT}
4043			}
4044		""
4045	end
4046
4047	case equal_highp_vec2_highp_vec2
4048		version 300 es
4049		values
4050		{
4051			output bool success = true;
4052		}
4053
4054		both ""
4055			#version 300 es
4056			precision highp float;
4057			${DECLARATIONS}
4058			void main()
4059			{
4060				${SETUP}
4061				highp vec2 x[3] = vec2[3](vec2(1.0, 2.0),
4062										  vec2(3.0, 4.0),
4063										  vec2(5.0, 6.0));
4064				highp vec2 y[3] = x;
4065				x = y;
4066				success = (x == y);
4067				${OUTPUT}
4068			}
4069		""
4070	end
4071
4072	case equal_highp_vec3_highp_vec3
4073		version 300 es
4074		values
4075		{
4076			output bool success = true;
4077		}
4078
4079		both ""
4080			#version 300 es
4081			precision highp float;
4082			${DECLARATIONS}
4083			void main()
4084			{
4085				${SETUP}
4086				highp vec3 x[3] = vec3[3](vec3(1.0, 2.0, 3.0),
4087										  vec3(4.0, 5.0, 6.0),
4088										  vec3(7.0, 8.0, 9.0));
4089				highp vec3 y[3] = x;
4090				x = y;
4091				success = (x == y);
4092				${OUTPUT}
4093			}
4094		""
4095	end
4096
4097	case equal_highp_vec4_highp_vec4
4098		version 300 es
4099		values
4100		{
4101			output bool success = true;
4102		}
4103
4104		both ""
4105			#version 300 es
4106			precision highp float;
4107			${DECLARATIONS}
4108			void main()
4109			{
4110				${SETUP}
4111				highp vec4 x[3] = vec4[3](vec4(1.0, 2.0, 3.0, 4.0),
4112										  vec4(5.0, 6.0, 7.0, 8.0),
4113										  vec4(9.0, 10.0, 11.0, 12.0));
4114				highp vec4 y[3] = x;
4115				x = y;
4116				success = (x == y);
4117				${OUTPUT}
4118			}
4119		""
4120	end
4121
4122	case equal_highp_ivec2_highp_ivec2
4123		version 300 es
4124		values
4125		{
4126			output bool success = true;
4127		}
4128
4129		both ""
4130			#version 300 es
4131			precision highp float;
4132			${DECLARATIONS}
4133			void main()
4134			{
4135				${SETUP}
4136				highp ivec2 x[3] = ivec2[3](ivec2(1, 2),
4137											ivec2(3, 4),
4138											ivec2(5, 6));
4139				highp ivec2 y[3] = x;
4140				x = y;
4141				success = (x == y);
4142				${OUTPUT}
4143			}
4144		""
4145	end
4146
4147	case equal_highp_ivec3_highp_ivec3
4148		version 300 es
4149		values
4150		{
4151			output bool success = true;
4152		}
4153
4154		both ""
4155			#version 300 es
4156			precision highp float;
4157			${DECLARATIONS}
4158			void main()
4159			{
4160				${SETUP}
4161				highp ivec3 x[3] = ivec3[3](ivec3(1, 2, 3),
4162											ivec3(4, 5, 6),
4163											ivec3(7, 8, 9));
4164				highp ivec3 y[3] = x;
4165				x = y;
4166				success = (x == y);
4167				${OUTPUT}
4168			}
4169		""
4170	end
4171
4172	case equal_highp_ivec4_highp_ivec4
4173		version 300 es
4174		values
4175		{
4176			output bool success = true;
4177		}
4178
4179		both ""
4180			#version 300 es
4181			precision highp float;
4182			${DECLARATIONS}
4183			void main()
4184			{
4185				${SETUP}
4186				highp ivec4 x[3] = ivec4[3](ivec4(1, 2, 3, 4),
4187											ivec4(5, 6, 7, 8),
4188											ivec4(9, 10, 11, 12));
4189				highp ivec4 y[3] = x;
4190				x = y;
4191				success = (x == y);
4192				${OUTPUT}
4193			}
4194		""
4195	end
4196
4197	case equal_highp_uvec2_highp_uvec2
4198		version 300 es
4199		values
4200		{
4201			output bool success = true;
4202		}
4203
4204		both ""
4205			#version 300 es
4206			precision highp float;
4207			${DECLARATIONS}
4208			void main()
4209			{
4210				${SETUP}
4211				highp uvec2 x[3] = uvec2[3](uvec2(1u, 2u),
4212											uvec2(3u, 4u),
4213											uvec2(5u, 6u));
4214				highp uvec2 y[3] = x;
4215				x = y;
4216				success = (x == y);
4217				${OUTPUT}
4218			}
4219		""
4220	end
4221
4222	case equal_highp_uvec3_highp_uvec3
4223		version 300 es
4224		values
4225		{
4226			output bool success = true;
4227		}
4228
4229		both ""
4230			#version 300 es
4231			precision highp float;
4232			${DECLARATIONS}
4233			void main()
4234			{
4235				${SETUP}
4236				highp uvec3 x[3] = uvec3[3](uvec3(1u, 2u, 3u),
4237											uvec3(4u, 5u, 6u),
4238											uvec3(7u, 8u, 9u));
4239				highp uvec3 y[3] = x;
4240				x = y;
4241				success = (x == y);
4242				${OUTPUT}
4243			}
4244		""
4245	end
4246
4247	case equal_highp_uvec4_highp_uvec4
4248		version 300 es
4249		values
4250		{
4251			output bool success = true;
4252		}
4253
4254		both ""
4255			#version 300 es
4256			precision highp float;
4257			${DECLARATIONS}
4258			void main()
4259			{
4260				${SETUP}
4261				highp uvec4 x[3] = uvec4[3](uvec4(1u, 2u, 3u, 4u),
4262											uvec4(5u, 6u, 7u, 8u),
4263											uvec4(9u, 10u, 11u, 12u));
4264				highp uvec4 y[3] = x;
4265				x = y;
4266				success = (x == y);
4267				${OUTPUT}
4268			}
4269		""
4270	end
4271
4272	case equal_highp_mat2_highp_mat2
4273		version 300 es
4274		values
4275		{
4276			output bool success = true;
4277		}
4278
4279		both ""
4280			#version 300 es
4281			precision highp float;
4282			${DECLARATIONS}
4283			void main()
4284			{
4285				${SETUP}
4286				highp mat2 x[3] = mat2[3](mat2(1.0, 2.0, 3.0, 4.0),
4287										  mat2(5.0, 6.0, 7.0, 8.0),
4288										  mat2(9.0, 10.0, 11.0, 12.0));
4289				highp mat2 y[3] = x;
4290				x = y;
4291				success = (x == y);
4292				${OUTPUT}
4293			}
4294		""
4295	end
4296
4297	case equal_highp_mat3_highp_mat3
4298		version 300 es
4299		values
4300		{
4301			output bool success = true;
4302		}
4303
4304		both ""
4305			#version 300 es
4306			precision highp float;
4307			${DECLARATIONS}
4308			void main()
4309			{
4310				${SETUP}
4311				highp mat3 x[3] = mat3[3](mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0),
4312										  mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0),
4313										  mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0));
4314				highp mat3 y[3] = x;
4315				x = y;
4316				success = (x == y);
4317				${OUTPUT}
4318			}
4319		""
4320	end
4321
4322	case equal_highp_mat4_highp_mat4
4323		version 300 es
4324		values
4325		{
4326			output bool success = true;
4327		}
4328
4329		both ""
4330			#version 300 es
4331			precision highp float;
4332			${DECLARATIONS}
4333			void main()
4334			{
4335				${SETUP}
4336				highp mat4 x[3] = mat4[3](mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0),
4337										  mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0),
4338										  mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0));
4339				highp mat4 y[3] = x;
4340				x = y;
4341				success = (x == y);
4342				${OUTPUT}
4343			}
4344		""
4345	end
4346
4347end # compare
4348