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

/* { dg-output ".*OMP_DEFAULT_DEVICE = '0'.*OMP_TARGET_OFFLOAD = 'DEFAULT'.*" } */

#include <omp.h>

int
main ()
{
  int x;
  #pragma omp target map(tofrom:x)
    x = 5 + omp_is_initial_device ();

  if (x != 5 + (omp_get_default_device() == omp_get_initial_device()))
    __builtin_abort ();

  return 0;
}