aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c-c++-common/declare_target-1.c
blob: c5670dfb7db73408a39e1fd8b52f9961a7153fb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* PR c++/99509  */

#pragma omp declare target
int data[] = {5};
#pragma omp end declare target

static inline int
foo (int idx)
{
  return data[idx];
}

int
main ()
{
  int i = -1;
  #pragma omp target map(from:i)
    i = foo(0);
  if (i != 5)
    __builtin_abort ();
  return 0;
}