summaryrefslogtreecommitdiffstats
path: root/tests/bugs/gh-4434.slang
blob: f11f39f507522cf98a12f8d5418789ae0e059ddc (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
34
35
36
37
38
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-dx12
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-vk
//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-mtl
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cpu
//DISABLE_TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-cuda

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

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

[numthreads(4, 1, 1)]
void computeMain(uint tid : SV_GroupIndex)
{
    bool K = (bool)outputBuffer[tid];

    bool c = and(K, K);

    bool1 K1 = K;
    bool2 K2 = K;
    bool3 K3 = K;
    bool4 K4 = K;

    bool1 k = and(K, K);
    bool2 n = and(K, K);
    bool3 q = and(K, K);
    bool4 t = and(K, K);

    k = !and(k, false);
    n = !and(n, false);
    q = !and(q, false);
    t = !and(t, false);

    outputBuffer[tid] = all(k) && all(n) && all(q) && all(t);
}