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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ext/] [attr-alias-1.C] - Blame information for rev 696

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

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do run }  */
2
/* { dg-require-alias "" } */
3
 
4
#include 
5
 
6
struct Klass
7
{
8
  int implementation () const;
9
  int magic () const;
10
};
11
 
12
int Klass::implementation (void) const
13
{
14
  return 0;
15
}
16
 
17
int Klass::magic () const
18
  __attribute__ ((alias ("_ZNK5Klass14implementationEv")));
19
 
20
int __attribute__ ((noinline))
21
  Foo (Klass const *ptr)
22
{
23
  if (ptr->magic () != 0)
24
    return 1;
25
 
26
  if (typeid (*ptr) != typeid (Klass))
27
    return 2;
28
 
29
  return 0;
30
}
31
 
32
int main ()
33
{
34
  Klass obj;
35
 
36
  return Foo (&obj);
37
}

powered by: WebSVN 2.1.0

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