1 /* { dg-do compile } */
2 /* { dg-options "-g" } */
3 /* { dg-skip-if "" { { hppa*-*-hpux* powerpc-ibm-aix* } && { ! hppa*64*-*-* } } } */
5 /* Make sure we didn't eliminate casted types because we thought they were
10 struct foo { int i; };
13 return ((struct foo *)0x1234)->i;
16 struct boo { int i; };
19 return reinterpret_cast<struct boo *>(0xC0FFEE)->i;
22 struct cue { int i; };
25 return static_cast<struct cue *>(voidp)->i;
28 class printer { public: int i; };
29 const printer *dotmatrix;
32 return const_cast<printer *>(dotmatrix)->i;
35 class class1 { public: virtual ~class1(); } *c1;
36 class class2 : class1 { char j; };
39 if (dynamic_cast <class2 *>(c1))
44 /* { dg-final { scan-assembler "foo" } } */
45 /* { dg-final { scan-assembler "boo" } } */
46 /* { dg-final { scan-assembler "cue" } } */
47 /* The xfail below is for PR33429. */
48 /* { dg-final { scan-assembler "(string|ascii?)z?\[\t \]\"class2(\"|\\\\0)" { xfail *-*-* } } } */
49 /* { dg-final { scan-assembler "(string|ascii?)z?\[\t \]\"printer(\"|\\\\0)" } } */