summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/target-30.c
blob: a309f7d1a21ba827a5c458af7087963c277e132f (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
extern void abort (void);

#pragma omp declare target
int v = 6;
#pragma omp end declare target

int
main ()
{
  #pragma omp target /* predetermined map(tofrom: v) */
  v++;
  #pragma omp target update from (v)
  if (v != 7)
    abort ();
  #pragma omp parallel private (v) num_threads (1)
  {
    #pragma omp target /* predetermined firstprivate(v) */
    v++;
  }
  #pragma omp target update from (v)
  if (v != 7)
    abort ();
  return 0;
}