OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [badopt1.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// { dg-options "-O2" }
3
// Based on a testcase by Bryan Weston 
4
// egcs 1.1 fails to increment count
5
 
6
 
7
struct Base { Base() {} }; // removing the constructor fixes the problem
8
struct Derived : Base {}; // so does removing the base class
9
 
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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.