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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [ctors16.C] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do run  }
2
// GROUPS passed constructors
3
// ctor file
4
// Message-Id: <9306021533.AA14347@icepick.jts.com>
5
// From: roland@jts.com (Roland Knight )
6
// Subject: gcc 2.4.1 bug
7
// Date:   Wed, 2 Jun 1993 11:33:34 -0400
8
 
9
#include 
10
#include 
11
#include 
12
 
13
char stuff[50];
14
char *p = stuff;
15
 
16
class A {
17
public:
18
    A() { *p++ = 'A';}
19
};
20
 
21
class B {
22
public:
23
    B() { *p++ = 'B'; }
24
};
25
 
26
class C : public A, public B {
27
public:
28
    C() : B(), A() { *p++ = 'C'; }
29
};
30
 
31
class D : public A, public B {
32
public:
33
    D() : B() { *p++ = 'D'; }
34
};
35
 
36
class E : public A, public B {
37
public:
38
    E() { *p++ = 'E'; }
39
};
40
 
41
 
42
int main() {
43
    C c;
44
    D d;
45
    E e;
46
    if (strncmp ("ABCABDABE", stuff, 9))
47
        { printf ("FAIL\n"); return 1; }
48
    else
49
        printf ("PASS\n");
50
}

powered by: WebSVN 2.1.0

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