1cb93a386Sopenharmony_ciuniform half4 testInputs;
2cb93a386Sopenharmony_ciuniform half4 colorGreen, colorRed;
3cb93a386Sopenharmony_ci
4cb93a386Sopenharmony_cihalf4 main(float2 coords) {
5cb93a386Sopenharmony_ci    half4 expectedA       = half4(-1,     0,  0.75, 1);
6cb93a386Sopenharmony_ci
7cb93a386Sopenharmony_ci    const half4 clampLow  = half4(-1,    -2, -2,    1);
8cb93a386Sopenharmony_ci    const half4 constVal  = half4(-1.25,  0,  0.75, 2.25);
9cb93a386Sopenharmony_ci    half4 expectedB       = half4(-1,     0,  0.5,  2.25);
10cb93a386Sopenharmony_ci    const half4 clampHigh = half4( 1,     2,  0.5,  3);
11cb93a386Sopenharmony_ci
12cb93a386Sopenharmony_ci    return (clamp(testInputs.x,    -1, 1)                         == expectedA.x     &&
13cb93a386Sopenharmony_ci            clamp(testInputs.xy,   -1, 1)                         == expectedA.xy    &&
14cb93a386Sopenharmony_ci            clamp(testInputs.xyz,  -1, 1)                         == expectedA.xyz   &&
15cb93a386Sopenharmony_ci            clamp(testInputs.xyzw, -1, 1)                         == expectedA.xyzw  &&
16cb93a386Sopenharmony_ci            clamp(constVal.x,      -1, 1)                         == expectedA.x     &&
17cb93a386Sopenharmony_ci            clamp(constVal.xy,     -1, 1)                         == expectedA.xy    &&
18cb93a386Sopenharmony_ci            clamp(constVal.xyz,    -1, 1)                         == expectedA.xyz   &&
19cb93a386Sopenharmony_ci            clamp(constVal.xyzw,   -1, 1)                         == expectedA.xyzw  &&
20cb93a386Sopenharmony_ci            clamp(testInputs.x,    clampLow.x,    clampHigh.x   ) == expectedB.x     &&
21cb93a386Sopenharmony_ci            clamp(testInputs.xy,   clampLow.xy,   clampHigh.xy  ) == expectedB.xy    &&
22cb93a386Sopenharmony_ci            clamp(testInputs.xyz,  clampLow.xyz,  clampHigh.xyz ) == expectedB.xyz   &&
23cb93a386Sopenharmony_ci            clamp(testInputs.xyzw, clampLow.xyzw, clampHigh.xyzw) == expectedB.xyzw  &&
24cb93a386Sopenharmony_ci            clamp(constVal.x,      clampLow.x,    clampHigh.x   ) == expectedB.x     &&
25cb93a386Sopenharmony_ci            clamp(constVal.xy,     clampLow.xy,   clampHigh.xy  ) == expectedB.xy    &&
26cb93a386Sopenharmony_ci            clamp(constVal.xyz,    clampLow.xyz,  clampHigh.xyz ) == expectedB.xyz   &&
27cb93a386Sopenharmony_ci            clamp(constVal.xyzw,   clampLow.xyzw, clampHigh.xyzw) == expectedB.xyzw) ? colorGreen
28cb93a386Sopenharmony_ci                                                                                     : colorRed;
29cb93a386Sopenharmony_ci}
30