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