96a71bd53c
2016-03-07 Martin Jambor <mjambor@suse.cz> * testsuite/lib/libgomp.exp (check_effective_target_hsa_offloading_selected_nocache): New. (check_effective_target_hsa_offloading_selected): Likewise. * testsuite/libgomp.hsa.c/c.exp: Likewise. * testsuite/libgomp.hsa.c/alloca-1.c: Likewise. * testsuite/libgomp.hsa.c/bitfield-1.c: Likewise. * testsuite/libgomp.hsa.c/builtins-1.c: Likewise. * testsuite/libgomp.hsa.c/complex-1.c: Likewise. * testsuite/libgomp.hsa.c/formal-actual-args-1.c: Likewise. * testsuite/libgomp.hsa.c/function-call-1.c: Likewise. * testsuite/libgomp.hsa.c/get-level-1.c: Likewise. * testsuite/libgomp.hsa.c/gridify-1.c: Likewise. * testsuite/libgomp.hsa.c/gridify-2.c: Likewise. * testsuite/libgomp.hsa.c/gridify-3.c: Likewise. * testsuite/libgomp.hsa.c/gridify-4.c: Likewise. * testsuite/libgomp.hsa.c/memory-operations-1.c: Likewise. * testsuite/libgomp.hsa.c/pr69568.c: Likewise. * testsuite/libgomp.hsa.c/rotate-1.c: Likewise. * testsuite/libgomp.hsa.c/switch-1.c: Likewise. * testsuite/libgomp.hsa.c/switch-branch-1.c: Likewise. From-SVN: r234047
40 lines
772 B
C
40 lines
772 B
C
#define THE_LOOP \
|
|
for (i = j + 1; i < n; i += 3) \
|
|
a[i] = i
|
|
|
|
void __attribute__((noinline, noclone))
|
|
foo (int j, int n, int *a)
|
|
{
|
|
int i;
|
|
#pragma omp target
|
|
#pragma omp teams
|
|
#pragma omp distribute parallel for shared(a) firstprivate(n) private(i) firstprivate(j)
|
|
THE_LOOP;
|
|
}
|
|
|
|
void __attribute__((noinline, noclone))
|
|
bar (int j, int n, int *a)
|
|
{
|
|
int i;
|
|
THE_LOOP;
|
|
}
|
|
|
|
int main (int argc, char **argv)
|
|
{
|
|
int n = 32;
|
|
int *a = __builtin_malloc (sizeof (int) * n);
|
|
int *ref = __builtin_malloc (sizeof (int) * n);
|
|
int i, j = 4;
|
|
|
|
__builtin_memset (a, 0, sizeof (int) * n);
|
|
__builtin_memset (ref, 0, sizeof (int) * n);
|
|
bar (j, n, ref);
|
|
foo (j, n, a);
|
|
for (i = 0; i < n; i ++)
|
|
{
|
|
if (a[i] != ref[i])
|
|
__builtin_abort ();
|
|
}
|
|
return 0;
|
|
}
|