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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.bugs/] [900331_03.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// { dg-options "" }
3
// g++ 1.37.1 bug 900331_03
4
 
5
// Special Options: -ansi
6
 
7
// The following code causes g++ to abort.
8
 
9
// Curiously, the abort does not occur if the -pedantic option is used.
10
 
11
// Cfront 2.0 passes this test.
12
 
13
// Keywords: abort, conditional operator?:, lvalues, composite types
14
 
15
struct struct0 {
16
  int data_member;
17
 
18
  virtual void function_member () {}    // contributes to the abort
19
};
20
 
21
struct0 object0;
22
struct0 object1;
23
struct0 object2;
24
 
25
int i;
26
 
27
void function0 ()
28
{
29
  object2 = (i ? object0 : object1);            // OK
30
  (i ? object0 : object1) = object2;            // causes abort
31
}
32
 
33
int main () { return 0; }

powered by: WebSVN 2.1.0

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