fortran/openmp.cc: Fix var init and locus use to avoid uninit values [PR fortran...
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / constexpr-79379.C
blobdb0981d8b1aaf02da72a9e16daa2f70e150be979
1 // PR c++/79379
2 // { dg-do compile { target c++14 } }
3 // { dg-options "-O2" }
5 template <int N>
6 constexpr int
7 foo (int x)
9   int q[64] = { 0 }, r = 0;
10 #pragma GCC ivdep
11   for (int i = 0; i < x; ++i)
12     q[i] += 2;
13   for (int i = 0; i < x; ++i)
14     r += q[i];
15   return r + N;
18 constexpr int a = foo<0> (17);
19 static_assert (a == 34, "");