aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/asan/pr85081.C
blob: d7dec3114506f9fded88d1ebeb28442a777ee58d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* PR sanitizer/85081 */
/* { dg-do run } */
/* { dg-options "-fopenmp-simd" } */
/* { dg-require-effective-target fopenmp } */

inline const int& max(const int& a, const int& b)
{
  return a < b ? b : a;
}

int main()
{
  #pragma omp simd
  for ( int i = 0; i < 20; ++i )
  {
    const int j = max(i, 1);
  }

  return 0;
}