summaryrefslogtreecommitdiffstats
path: root/tests/optimization/get-array-element.slang
blob: 16a71aee24f78fabc42119395a93a3dee3c376b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//TEST:SIMPLE(filecheck=CHECK):-target spirv

int test(int arr[32]) {
    int sum = 0;
    for (int i =0; i < 32; i++) sum += arr[i];
    return sum;
}

uniform int gArr[32];
uniform int* result;

[numthreads(1,1,1)]
void computeMain()
{
    // CHECK-NOT: OpCompositeConstruct
    *result = test(gArr);
}