repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
/cp
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
constexpr-79379.C
blob
db0981d8b1aaf02da72a9e16daa2f70e150be979
1
// PR c++/79379
2
// { dg-do compile { target c++14 } }
3
// { dg-options "-O2" }
4
5
template <int N>
6
constexpr int
7
foo (int x)
8
{
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;
16
}
17
18
constexpr int a = foo<0> (17);
19
static_assert (a == 34, "");