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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.cp/] [m-data.cc] - Blame information for rev 842

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 jeremybenn
// 2002-05-13
2
 
3
enum region { oriental, egyptian, greek, etruscan, roman };
4
 
5
// Test one.
6
class gnu_obj_1
7
{
8
protected:
9
  typedef region antiquities;
10
  const bool            test;
11
  const int             key1;
12
  long                  key2;
13
 
14
  antiquities   value;
15
 
16
public:
17
  gnu_obj_1(antiquities a, long l): test(true), key1(5), key2(l), value(a) {}
18
};
19
 
20
// Test two.
21
template<typename T>
22
class gnu_obj_2: public virtual gnu_obj_1
23
{
24
protected:
25
  antiquities   value_derived;
26
 
27
public:
28
  gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { }
29
};
30
 
31
// Test three.
32
template<typename T>
33
class gnu_obj_3
34
{
35
protected:
36
  typedef region antiquities;
37
  gnu_obj_2<int>        data;
38
 
39
public:
40
  gnu_obj_3(antiquities b): data(etruscan) { }
41
};
42
 
43
int shadow = 0;
44
 
45
class C
46
{
47
public:
48
  C (int x) : shadow (x) {}
49
  void marker () {}
50
private:
51
  int shadow;
52
};
53
 
54
int main()
55
{
56
  gnu_obj_1             test1(egyptian, 4589);
57
  gnu_obj_2<long>       test2(roman);
58
  gnu_obj_3<long>       test3(greek);
59
 
60
  C theC (1);                           // breakpoint: first-constructs-done
61
  theC.marker ();
62
 
63
  return shadow;
64
}

powered by: WebSVN 2.1.0

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