summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/assign-in-if.slang
blob: ef2222365ebcc0dcffe4aa5ec6ab8ef54761a734 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//DIAGNOSTIC_TEST:REFLECTION:-stage compute -entry main -target hlsl

[numthreads(1, 1, 1)]
void main(
    uint3 dispatchThreadID : SV_DispatchThreadID)
{
    int a = 1;
    if (a = 0) // error
    {}
    if ((a = 0)) // ok.
    {}
}