URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do run }
|
// { dg-do run }
|
extern "C" int printf (const char *, ...);
|
extern "C" int printf (const char *, ...);
|
|
|
template
|
template
|
struct frob {
|
struct frob {
|
T *ptr;
|
T *ptr;
|
void print ();
|
void print ();
|
frob (T* init) { ptr = init; }
|
frob (T* init) { ptr = init; }
|
};
|
};
|
|
|
template
|
template
|
void frob::print () {
|
void frob::print () {
|
printf ("this = %08x\n", this);
|
printf ("this = %08x\n", this);
|
printf (" ptr = %08x\n", ptr);
|
printf (" ptr = %08x\n", ptr);
|
printf (" values = %x %x %x ...\n", ptr[0], ptr[1], ptr[2]);
|
printf (" values = %x %x %x ...\n", ptr[0], ptr[1], ptr[2]);
|
}
|
}
|
|
|
static int x[10];
|
static int x[10];
|
frob fc ("hello");
|
frob fc ("hello");
|
frob fi (x);
|
frob fi (x);
|
|
|
int main () {
|
int main () {
|
fc.print ();
|
fc.print ();
|
fi.print ();
|
fi.print ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.