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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ext/] [attr-ifunc-2.C] - Blame information for rev 821

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-ifunc "" } */
3
/* { dg-options "-Wno-pmf-conversions" } */
4
 
5
#include 
6
 
7
struct Klass
8
{
9
  int implementation ();
10
  int magic ();
11
  static void *resolver ();
12
};
13
 
14
int Klass::implementation (void)
15
{
16
  printf ("'ere I am JH\n");
17
  return 0;
18
}
19
 
20
void *Klass::resolver (void)
21
{
22
  int (Klass::*pmf) () = &Klass::implementation;
23
 
24
  return (void *)(int (*)(Klass *))(((Klass *)0)->*pmf);
25
}
26
 
27
int Klass::magic (void) __attribute__ ((ifunc ("_ZN5Klass8resolverEv")));
28
 
29
struct Klassier : Klass
30
{
31
};
32
 
33
int main ()
34
{
35
  Klassier obj;
36
 
37
  return obj.magic () != 0;
38
}

powered by: WebSVN 2.1.0

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