1 // { dg-do run  }
2 // { dg-options "-O2" }
3 // Based on a testcase by Bryan Weston <bryanw@bluemoon.sps.mot.com>
4 // egcs 1.1 fails to increment count
5 
6 
BaseBase7 struct Base { Base() {} }; // removing the constructor fixes the problem
8 struct Derived : Base {}; // so does removing the base class
9 
main()10 int main() {
11   int count = 0;
12   Derived* array[1]; // making this Base*[1] does not fix the problem
13   array[count++] = new Derived (); // but then new Base() does
14   if (count!=1)
15     return 1;
16 }
17