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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [other/] [unused1.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-g" } */
3
/* { dg-skip-if "" { { hppa*-*-hpux* *-*-solaris2.[56]* } && { ! hppa*64*-*-* } } { "*" } { "" } } */
4
 
5
/* Make sure we didn't eliminate casted types because we thought they were
6
   unused.  */
7
 
8
void *voidp;
9
 
10
struct foo { int i; };
11
int bar (void)
12
{
13
    return ((struct foo *)0x1234)->i;
14
}
15
 
16
struct boo { int i; };
17
int bar2 (void)
18
{
19
  return reinterpret_cast(0xC0FFEE)->i;
20
}
21
 
22
struct cue { int i; };
23
int bar3 (void)
24
{
25
  return static_cast(voidp)->i;
26
}
27
 
28
class printer { public: int i; };
29
const printer *dotmatrix;
30
int bar4 (void)
31
{
32
  return const_cast(dotmatrix)->i;
33
}
34
 
35
class class1 { public: virtual ~class1(); } *c1;
36
class class2 : class1 { char j; };
37
int bar5 (void)
38
{
39
  if (dynamic_cast (c1))
40
    return 5;
41
  else
42
    return 6;
43
}
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)" } } */

powered by: WebSVN 2.1.0

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