aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/gomp/declare-target-indirect-2.c
blob: 75a205feb957020d9398129f09e03b4d8acdb9f3 (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
/* { dg-do compile } */
/* { dg-options "-fopenmp -fdump-tree-gimple" } */

#pragma omp begin declare target indirect
void fn1 (void) { }
#pragma omp end declare target
/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target, omp declare target indirect\\\)\\\)\\\nvoid fn1" "gimple" } } */

#pragma omp begin declare target indirect (0)
void fn2 (void) { }
#pragma omp end declare target
/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target\\\)\\\)\\\nvoid fn2" "gimple" } } */

void fn3 (void) { }
#pragma omp declare target indirect to (fn3)
/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target indirect, omp declare target\\\)\\\)\\\nvoid fn3" "gimple" } } */

void fn4 (void) { }
#pragma omp declare target indirect (0) to (fn4)
/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target\\\)\\\)\\\nvoid fn4" "gimple" } } */

#pragma omp begin declare target indirect(1)
  int foo(void) { return 5; }
  #pragma omp begin declare target indirect(0)
    int bar(void) { return 8; }
    int baz(void) { return 11; }
    #pragma omp declare target indirect enter(baz)
  #pragma omp end declare target
#pragma omp end declare target
/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target, omp declare target indirect\\\)\\\)\\\nint foo" "gimple" } } */
/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target\\\)\\\)\\\nint bar" "gimple" } } */
/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target indirect, omp declare target\\\)\\\)\\\nint baz" "gimple" } } */