1cb93a386Sopenharmony_ci
2cb93a386Sopenharmony_ciout vec4 sk_FragColor;
3cb93a386Sopenharmony_ciuniform vec4 colorGreen;
4cb93a386Sopenharmony_ciuniform vec4 colorRed;
5cb93a386Sopenharmony_cibool test_half_b() {
6cb93a386Sopenharmony_ci    bool ok = true;
7cb93a386Sopenharmony_ci    mat2 m1 = mat2(1.0, 2.0, 3.0, 4.0);
8cb93a386Sopenharmony_ci    ok = ok && m1 == mat2(1.0, 2.0, 3.0, 4.0);
9cb93a386Sopenharmony_ci    mat2 m3 = m1;
10cb93a386Sopenharmony_ci    ok = ok && m3 == mat2(1.0, 2.0, 3.0, 4.0);
11cb93a386Sopenharmony_ci    mat2 m4 = mat2(6.0);
12cb93a386Sopenharmony_ci    ok = ok && m4 == mat2(6.0, 0.0, 0.0, 6.0);
13cb93a386Sopenharmony_ci    m3 *= m4;
14cb93a386Sopenharmony_ci    ok = ok && m3 == mat2(6.0, 12.0, 18.0, 24.0);
15cb93a386Sopenharmony_ci    mat2 m5 = mat2(m1[1].y);
16cb93a386Sopenharmony_ci    ok = ok && m5 == mat2(4.0, 0.0, 0.0, 4.0);
17cb93a386Sopenharmony_ci    m1 += m5;
18cb93a386Sopenharmony_ci    ok = ok && m1 == mat2(5.0, 2.0, 3.0, 8.0);
19cb93a386Sopenharmony_ci    mat2 m7 = mat2(5.0, 6.0, 7.0, 8.0);
20cb93a386Sopenharmony_ci    ok = ok && m7 == mat2(5.0, 6.0, 7.0, 8.0);
21cb93a386Sopenharmony_ci    mat3 m9 = mat3(9.0);
22cb93a386Sopenharmony_ci    ok = ok && m9 == mat3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 9.0);
23cb93a386Sopenharmony_ci    mat4 m10 = mat4(11.0);
24cb93a386Sopenharmony_ci    ok = ok && m10 == mat4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0);
25cb93a386Sopenharmony_ci    mat4 m11 = mat4(20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0);
26cb93a386Sopenharmony_ci    m11 -= m10;
27cb93a386Sopenharmony_ci    ok = ok && m11 == mat4(9.0, 20.0, 20.0, 20.0, 20.0, 9.0, 20.0, 20.0, 20.0, 20.0, 9.0, 20.0, 20.0, 20.0, 20.0, 9.0);
28cb93a386Sopenharmony_ci    return ok;
29cb93a386Sopenharmony_ci}
30cb93a386Sopenharmony_cibool test_comma_b() {
31cb93a386Sopenharmony_ci    mat2 x;
32cb93a386Sopenharmony_ci    mat2 y;
33cb93a386Sopenharmony_ci    return ((x = mat2(1.0, 2.0, 3.0, 4.0) , y = 0.5 * mat2(2.0, 4.0, 6.0, 8.0)) , x == y);
34cb93a386Sopenharmony_ci}
35cb93a386Sopenharmony_civec4 main() {
36cb93a386Sopenharmony_ci    bool _0_ok = true;
37cb93a386Sopenharmony_ci    mat2 _1_m1 = mat2(1.0, 2.0, 3.0, 4.0);
38cb93a386Sopenharmony_ci    _0_ok = _0_ok && _1_m1 == mat2(1.0, 2.0, 3.0, 4.0);
39cb93a386Sopenharmony_ci    mat2 _2_m3 = _1_m1;
40cb93a386Sopenharmony_ci    _0_ok = _0_ok && _2_m3 == mat2(1.0, 2.0, 3.0, 4.0);
41cb93a386Sopenharmony_ci    mat2 _3_m4 = mat2(6.0);
42cb93a386Sopenharmony_ci    _0_ok = _0_ok && _3_m4 == mat2(6.0, 0.0, 0.0, 6.0);
43cb93a386Sopenharmony_ci    _2_m3 *= _3_m4;
44cb93a386Sopenharmony_ci    _0_ok = _0_ok && _2_m3 == mat2(6.0, 12.0, 18.0, 24.0);
45cb93a386Sopenharmony_ci    mat2 _4_m5 = mat2(_1_m1[1].y);
46cb93a386Sopenharmony_ci    _0_ok = _0_ok && _4_m5 == mat2(4.0, 0.0, 0.0, 4.0);
47cb93a386Sopenharmony_ci    _1_m1 += _4_m5;
48cb93a386Sopenharmony_ci    _0_ok = _0_ok && _1_m1 == mat2(5.0, 2.0, 3.0, 8.0);
49cb93a386Sopenharmony_ci    mat2 _5_m7 = mat2(5.0, 6.0, 7.0, 8.0);
50cb93a386Sopenharmony_ci    _0_ok = _0_ok && _5_m7 == mat2(5.0, 6.0, 7.0, 8.0);
51cb93a386Sopenharmony_ci    mat3 _6_m9 = mat3(9.0);
52cb93a386Sopenharmony_ci    _0_ok = _0_ok && _6_m9 == mat3(9.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0, 9.0);
53cb93a386Sopenharmony_ci    mat4 _7_m10 = mat4(11.0);
54cb93a386Sopenharmony_ci    _0_ok = _0_ok && _7_m10 == mat4(11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 11.0);
55cb93a386Sopenharmony_ci    mat4 _8_m11 = mat4(20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0);
56cb93a386Sopenharmony_ci    _8_m11 -= _7_m10;
57cb93a386Sopenharmony_ci    _0_ok = _0_ok && _8_m11 == mat4(9.0, 20.0, 20.0, 20.0, 20.0, 9.0, 20.0, 20.0, 20.0, 20.0, 9.0, 20.0, 20.0, 20.0, 20.0, 9.0);
58cb93a386Sopenharmony_ci    return (_0_ok && test_half_b()) && test_comma_b() ? colorGreen : colorRed;
59cb93a386Sopenharmony_ci}
60