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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [expr/] [cast4.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do run }
2
// PR c++/22132
3
 
4
extern "C" void abort ();
5
 
6
struct foo {
7
  int a;
8
  int b;
9
};
10
 
11
class Foobar : public foo {
12
public:
13
  Foobar() { a = 1; b = 2; }
14
  virtual ~Foobar() {}
15
};
16
 
17
Foobar obj;
18
const Foobar* objPtr = &obj;
19
foo* f = (foo*)objPtr;
20
 
21
int main () {
22
  if (f->a != 1 || f->b != 2)
23
    abort ();
24
}
25
 

powered by: WebSVN 2.1.0

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