summaryrefslogtreecommitdiffstats
path: root/tests/bugs/generic-initializer-inlining.slang
blob: 8f126e43a91375efac9859d4fdc69a8357911b10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu

// CHECK:      1
// CHECK-NEXT: 0
// CHECK-NEXT: 0
// CHECK-NEXT: 0

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
RWStructuredBuffer<uint> outputBuffer;

struct C<T>
{
    [ForceInline]
    __init<U>(U value)
    {
        for (int i = 0; i < 1; ++i)
        {}
    }
}

static C<int> c = C<int>(1);

int use<T>(T x)
{
    return 1;
}

[numthreads(1, 1, 1)]
void computeMain(uint i : SV_GroupIndex)
{
    outputBuffer[0] = use(c);
}