aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-c-c++-common/if-self-1.c
blob: f77edda83e32e6c6f2b75802a9b643c399b8439f (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
/* Test 'if' and 'self' clause appearing together.  */

#include <openacc.h>

static int test(float i, long double s)
{
  int ret;
#pragma acc serial copyout(ret) if(i) self(s)
  /* { dg-bogus {using 'vector_length \(32\)', ignoring 1} {} { xfail openacc_nvidia_accel_selected } .-1 } */
  {
    ret = acc_on_device(acc_device_host);
  }
  return ret;
}

int main()
{
  if (!test(0, 0))
    __builtin_abort();

  if (!test(0, 1))
    __builtin_abort();

#if ACC_MEM_SHARED
  if (!test(1, 0))
    __builtin_abort();
#else
  if (test(1, 0))
    __builtin_abort();
#endif

  if (!test(1, 1))
    __builtin_abort();

  return 0;
}