summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/pr77844.C
blob: 66eb978ddb75a7276a2f05c8b3e695b061a3e2a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// PR debug/77844
// { dg-do compile }
// { dg-options "-O3 -g" }

#include <vector>

void
foo (std::vector<bool>& v, int i, int j)
{
  for (int k = 0; k < 5; ++k)
    v[5 * i + k] = v[5 * i + k] | v[5 * j + k];
}

void
bar (std::vector<bool>& v, int i, int j)
{
  for (int k = 0; k < 5; ++k)
    v[5 * i + k] = v[5 * i + k] ^ v[5 * j + k];
}

void
baz (std::vector<bool>& v)
{
  foo (v, 4, 1);
  foo (v, 4, 2);
  foo (v, 4, 3);
  foo (v, 4, 4);
  bar (v, 4, 1);
  bar (v, 4, 2);
  bar (v, 4, 3);
  bar (v, 4, 4);
}