aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/gomp/dispatch-9.c
blob: b4b46b946fdc69d5c72632c8df86bc8793015d13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* { dg-do compile } */
/* { dg-additional-options "-fdump-tree-original -fdump-tree-gimple" } */

/* Check that the right call to f is wrapped in a GOMP_DISPATCH internal function
   before translation and that it is stripped during gimplification. */

int f(int);
void g(int *x)
{
  #pragma omp dispatch
  x[f(1)] = f(f(2));
  //        ^ only this call to f is a dispatch call
}

/* { dg-final { scan-tree-dump "\.GOMP_DISPATCH \\(f \\(f \\(2\\)\\)\\)" "original" } } */
/* { dg-final { scan-tree-dump-times "\.GOMP_DISPATCH" 1 "original" } } */
/* { dg-final { scan-tree-dump-not "\.GOMP_DISPATCH" "gimple" } } */