% lhs casts to the same type don't have effect.
[pixel shader]
float4 main() : sv_target
{
    float4 p = 0;

    (float4) p = float4(1, 2, 3, 4);
    return p;
}

[test]
draw quad
probe (0, 0) rgba(1, 2, 3, 4)


% Casts with base type changes are only valid on SM1.
[pixel shader fail(sm>=4)]
float4 main() : sv_target
{
    float4 p = 0;

    (int4) p = float4(-1.5, -2.3, 4.7, 0.4);
    return p;
}

[test]
draw quad
probe (0, 0) rgba(-1, -2, 4, 0)


% Casts don't actually perform base type changes, only the outermost one, which
% I suspect is because the implicit cast on the assignment and not the cast itself.
[pixel shader fail(sm>=4)]
float4 main() : sv_target
{
    float4 f = 0;

    (float2x2)(int4)(half4) f = float4(1.3, -2.4, 3.3, 4.7);
    return f;
}

[test]
draw quad
probe (0, 0) rgba(1.3, -2.4, 3.3, 4.7)


[pixel shader fail(sm>=4)]
float4 main() : sv_target
{
    float4 f = 0;

    (int4)(float4)(half4) f = float4(1.3, -2.4, 3.3, 4.7);
    return f;
}

[test]
draw quad
probe (0, 0) rgba(1, -2, 3, 4)


[pixel shader fail]
float4 main() : sv_target
{
    float p[5] = {-1, -2, -3, -4, -5};
    float arr[5] = {1.5, 2.5, 3.5, 4.5, 5.5};

    (int[5]) p = arr;
    return 0;
}


[pixel shader fail(sm>=6) todo(sm>=4)]
float4 main() : sv_target
{
    float4 f = 0;

    (float2x2) f = float3x2(1, 2, 3, 4, 5, 6);
    return f;
}

[test]
todo(sm>=4) draw quad
probe (0, 0) rgba(1, 2, 3, 4)


[pixel shader fail(sm>=4)]
float4 main() : sv_target
{
    float4 f = 0;

    ((int4) f).xy = float2(1.4, 3.8);
    return f;
}

[test]
draw quad
probe (0, 0) rgba(1, 3, 0, 0);


[pixel shader fail(sm>=4)]
float4 main() : sv_target
{
    float4 f = 0;

    ((float3)((int4) f).xyz).xy = float2(1.4, 2.8);
    return f;
}

[test]
draw quad
probe (0, 0) rgba(1.4, 2.8, 0, 0);
