summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/bool1.C
blob: 78cdebe32aa5b4ca8d11cffeef2ee0901c0b6adf (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
// PR opt/13869
// { dg-do run }
// { dg-options "-O2" }

extern "C" void abort ();

int test ()
{
  bool my_bool = true;
  for (int i = 0; i < 10; ++i)
    {
      if (!my_bool)
	;
      else
	my_bool = false;
    };
  return my_bool;
}

int main ()
{
  if (test ())
    abort ();
  return 0;
}