Reset prologue_location before calling code_end
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-c-c++-common / mapping-1.c
blob593e7d4d553bb08545ed1a8fcf592f0fc8ca63f2
1 /* { dg-do run } */
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <unistd.h>
7 /* Exercise the kernel launch argument mapping. */
9 int
10 main (int argc, char **argv)
12 int a[256], b[256], c[256], d[256], e[256], f[256];
13 int i;
14 int n;
16 /* 48 is the size of the mappings for the first parallel construct. */
17 n = sysconf (_SC_PAGESIZE) / 48 - 1;
19 i = 0;
21 for (i = 0; i < n; i++)
23 #pragma acc parallel copy (a, b, c, d)
25 int j;
27 for (j = 0; j < 256; j++)
29 a[j] = j;
30 b[j] = j;
31 c[j] = j;
32 d[j] = j;
37 #pragma acc parallel copy (a, b, c, d, e, f)
39 int j;
41 for (j = 0; j < 256; j++)
43 a[j] = j;
44 b[j] = j;
45 c[j] = j;
46 d[j] = j;
47 e[j] = j;
48 f[j] = j;
52 for (i = 0; i < 256; i++)
54 if (a[i] != i) abort();
55 if (b[i] != i) abort();
56 if (c[i] != i) abort();
57 if (d[i] != i) abort();
58 if (e[i] != i) abort();
59 if (f[i] != i) abort();
62 exit (0);