OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gdb/] [gdb-6.8/] [gdb-6.8.openrisc-2.1/] [gdb/] [testsuite/] [gdb.cp/] [m-data.cc] - Diff between revs 24 and 33

Only display areas with differences | Details | Blame | View Log

Rev 24 Rev 33
// 2002-05-13
// 2002-05-13
 
 
enum region { oriental, egyptian, greek, etruscan, roman };
enum region { oriental, egyptian, greek, etruscan, roman };
 
 
// Test one.
// Test one.
class gnu_obj_1
class gnu_obj_1
{
{
protected:
protected:
  typedef region antiquities;
  typedef region antiquities;
  const bool            test;
  const bool            test;
  const int             key1;
  const int             key1;
  long                  key2;
  long                  key2;
 
 
  antiquities   value;
  antiquities   value;
 
 
public:
public:
  gnu_obj_1(antiquities a, long l): test(true), key1(5), key2(l), value(a) {}
  gnu_obj_1(antiquities a, long l): test(true), key1(5), key2(l), value(a) {}
};
};
 
 
// Test two.
// Test two.
template<typename T>
template<typename T>
class gnu_obj_2: public virtual gnu_obj_1
class gnu_obj_2: public virtual gnu_obj_1
{
{
protected:
protected:
  antiquities   value_derived;
  antiquities   value_derived;
 
 
public:
public:
  gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { }
  gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { }
};
};
 
 
// Test three.
// Test three.
template<typename T>
template<typename T>
class gnu_obj_3
class gnu_obj_3
{
{
protected:
protected:
  typedef region antiquities;
  typedef region antiquities;
  gnu_obj_2<int>        data;
  gnu_obj_2<int>        data;
 
 
public:
public:
  gnu_obj_3(antiquities b): data(etruscan) { }
  gnu_obj_3(antiquities b): data(etruscan) { }
};
};
 
 
int shadow = 0;
int shadow = 0;
 
 
class C
class C
{
{
public:
public:
  C (int x) : shadow (x) {}
  C (int x) : shadow (x) {}
  void marker () {}
  void marker () {}
private:
private:
  int shadow;
  int shadow;
};
};
 
 
int main()
int main()
{
{
  gnu_obj_1             test1(egyptian, 4589);
  gnu_obj_1             test1(egyptian, 4589);
  gnu_obj_2<long>       test2(roman);
  gnu_obj_2<long>       test2(roman);
  gnu_obj_3<long>       test3(greek);
  gnu_obj_3<long>       test3(greek);
 
 
  C theC (1);                           // breakpoint: first-constructs-done
  C theC (1);                           // breakpoint: first-constructs-done
  theC.marker ();
  theC.marker ();
 
 
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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