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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// Copyright (C) 2000 Free Software Foundation, Inc.
3
// Contributed by Nathan Sidwell 4 February 2001 
4
 
5
// Check primary bases are chosen correctly.
6
 
7
struct A {virtual void Foo () {}};
8
struct B1 : virtual A {};
9
struct B2 : virtual A {};
10
struct C : virtual B1, B2 {};
11
struct D : virtual C {};
12
 
13
int main ()
14
{
15
  C c;
16
  D d;
17
 
18
  A *apc = &c;
19
  B1 *b1pc = &c;
20
  B2 *b2pc = &c;
21
 
22
  A *apd = &d;
23
  B1 *b1pd = &d;
24
  B2 *b2pd = &d;
25
  C *cpd = &d;
26
 
27
#if __GXX_ABI_VERSION >= 100
28
  if (static_cast  (apc) != static_cast  (b1pc))
29
    return 1;
30
  if (static_cast  (&c) != static_cast  (b2pc))
31
    return 2;
32
  if (static_cast  (b1pc) == static_cast  (b2pc))
33
    return 3;
34
 
35
  if (static_cast  (apd) != static_cast  (b1pd))
36
    return 11;
37
  if (static_cast  (b2pd) != static_cast  (&d))
38
    return 12;
39
  if (static_cast  (b2pd) != static_cast  (cpd))
40
    return 13;
41
  if (static_cast  (b1pd) == static_cast  (b2pd))
42
    return 14;
43
#endif
44
  return 0;
45
}

powered by: WebSVN 2.1.0

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