Debian Codegraph @

gcc/testsuite/g++.dg/opt/pr77844.C

raw
1 // PR debug/77844
2 // { dg-do compile }
3 // { dg-options "-O3 -g" }
4 // { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } }
5
6 #include <vector>
7
8 void
9 foo (std::vector<bool>& v, int i, int j)
10 {
11 for (int k = 0; k < 5; ++k)
12 v[5 * i + k] = v[5 * i + k] | v[5 * j + k];
13 }
14
15 void
16 bar (std::vector<bool>& v, int i, int j)
17 {
18 for (int k = 0; k < 5; ++k)
19 v[5 * i + k] = v[5 * i + k] ^ v[5 * j + k];
20 }
21
22 void
23 baz (std::vector<bool>& v)
24 {
25 foo (v, 4, 1);
26 foo (v, 4, 2);
27 foo (v, 4, 3);
28 foo (v, 4, 4);
29 bar (v, 4, 1);
30 bar (v, 4, 2);
31 bar (v, 4, 3);
32 bar (v, 4, 4);
33 }