1// GLSL ES 1.0 does not allow *any* operators other than subscripting to be used with arrays, 2// or with structs containing arrays. SkSL (and later versions of GLSL) allow assignment and 3// equality for those types. This file tests operators that would be legal, but should be flagged 4// as errors. A related consequence (also tested here) is that functions can not return arrays, 5// or structs containing arrays. 6 7// Expect 17 errors 8 9struct S { int x[1]; }; // For "simple" case 10struct T { S s; }; // For trickier, nested case 11 12S s1, s2; 13T t1, t2; 14int a1[1]; int a2[1]; 15 16void assign_A() { a1 = a2; } 17void assign_S() { s1 = s2; } 18void assign_T() { t1 = t2; } 19 20// Note: No way to even write return_A() 21S return_S() { return s1; } 22T return_T() { return t1; } 23 24bool equals_A() { return a1 == a2; } 25bool equals_S() { return s1 == s2; } 26bool equals_T() { return t1 == t2; } 27 28bool notequals_A() { return a1 != a2; } 29bool notequals_S() { return s1 != s2; } 30bool notequals_T() { return t1 != t2; } 31 32void sequence_A() { a1, a2; } 33void sequence_S() { s1, s2; } 34void sequence_T() { t1, t2; } 35 36int ternary_A(bool b) { return (b ? a1 : a2) [0]; } 37int ternary_S(bool b) { return (b ? s1 : s2) .x[0]; } 38int ternary_T(bool b) { return (b ? t1 : t2).s.x[0]; } 39