1cb93a386Sopenharmony_ciuniform half4 colorGreen, colorRed;
2cb93a386Sopenharmony_ciuniform float2x2 testMatrix2x2;  // equals (1, 2, 3, 4)
3cb93a386Sopenharmony_ci
4cb93a386Sopenharmony_cihalf4 main(float2 coords) {
5cb93a386Sopenharmony_ci    float4 f4 = float4(testMatrix2x2);
6cb93a386Sopenharmony_ci
7cb93a386Sopenharmony_ci    // These matrices are intentionally assembled off-kilter; the vectors shouldn't line up with the
8cb93a386Sopenharmony_ci    // natural matrix stride. Metal and SPIR-V will need to reorder the data to make it fit.
9cb93a386Sopenharmony_ci    bool ok =  float2x3(f4.xyzw, f4.xy)                 == float2x3(1, 2, 3, 4, 1, 2);
10cb93a386Sopenharmony_ci    ok = ok && float2x4(f4.xyz, f4.wxyz, f4.w)          == float2x4(1, 2, 3, 4, 1, 2, 3, 4);
11cb93a386Sopenharmony_ci    ok = ok && float3x3(f4.xy, f4.zw, f4.xyzw, f4.x)    == float3x3(1, 2, 3, 4, 1, 2, 3, 4, 1);
12cb93a386Sopenharmony_ci    ok = ok && float4x2(f4.xyz, f4.wxyz, f4.w)          == float4x2(1, 2, 3, 4, 1, 2, 3, 4);
13cb93a386Sopenharmony_ci    ok = ok && float4x3(f4.x, f4.yzwx, f4.yzwx, f4.yzw) == float4x3(1, 2, 3,
14cb93a386Sopenharmony_ci                                                                    4, 1, 2,
15cb93a386Sopenharmony_ci                                                                    3, 4, 1,
16cb93a386Sopenharmony_ci                                                                    2, 3, 4);
17cb93a386Sopenharmony_ci    return ok ? colorGreen : colorRed;
18cb93a386Sopenharmony_ci}
19