aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/gomp/assume-4.c
blob: 9da2296fd1d660961c6819e5896e2f1f4f885cf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-options "-fopenmp -O2 -fdump-tree-optimized" } */
/* { dg-final { scan-tree-dump-times "return 42;" 2 "optimized" } } */
/* { dg-final { scan-tree-dump-not "return -1;" "optimized" } } */

int
foo (int x)
{
  int y;
  #pragma omp assume holds (x == 42)
  y = x;
  return y;
}

int
bar (int x)
{
  #pragma omp assume holds (x < 42)
  ;
  if (x == 42)
    return -1;
  return 42;
}