* config/arm/arm.c (arm_reorg): Skip Thumb reorg pass for thunks.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / kernels-private-vars-local-worker-3.c
blobba0b44dc5bef353a09115160e159432011a1664d
1 #include <assert.h>
3 /* Test of worker-private variables declared in a local scope, broadcasting
4 to vector-partitioned mode. Aggregate worker variable. */
6 typedef struct
8 int x, y;
9 } vec2;
11 int
12 main (int argc, char* argv[])
14 int i, arr[32 * 32 * 32];
16 for (i = 0; i < 32 * 32 * 32; i++)
17 arr[i] = i;
19 #pragma acc kernels copy(arr)
21 int j;
23 #pragma acc loop gang(num:32)
24 for (i = 0; i < 32; i++)
26 #pragma acc loop worker(num:32)
27 for (j = 0; j < 32; j++)
29 int k;
30 vec2 pt;
32 pt.x = i ^ j * 3;
33 pt.y = i | j * 5;
35 #pragma acc loop vector(length:32)
36 for (k = 0; k < 32; k++)
37 arr[i * 1024 + j * 32 + k] += pt.x * k;
39 #pragma acc loop vector(length:32)
40 for (k = 0; k < 32; k++)
41 arr[i * 1024 + j * 32 + k] += pt.y * k;
46 for (i = 0; i < 32; i++)
47 for (int j = 0; j < 32; j++)
48 for (int k = 0; k < 32; k++)
50 int idx = i * 1024 + j * 32 + k;
51 assert (arr[idx] == idx + (i ^ j * 3) * k + (i | j * 5) * k);
54 return 0;