aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/target-55.c
blob: 1314b3c69636e7f02a3531fb6e21bd59731fb24a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* { dg-do run { target { offload_device } } } */
/* { dg-set-target-env-var OMP_TARGET_OFFLOAD "mandatory" } */

/* Should pass - see target-55a.c for !offload_device */

/* Check OMP_TARGET_OFFLOAD - it shall run on systems with offloading
   devices available and fail otherwise.  Note that this did always
   fail - as the device handling wasn't initialized before doing the
   mandatory checking.  */

int
main ()
{
  int x = 1;
  #pragma omp target map(tofrom: x)
    x = 5;
  if (x != 5)
    __builtin_abort ();
  return 0;
}