URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
// GROUPS passed overloading
|
// GROUPS passed overloading
|
// Check that calls to the correct overloaded virtual
|
// Check that calls to the correct overloaded virtual
|
// functions are generated even where the type of the formal
|
// functions are generated even where the type of the formal
|
// arguments for the overloadings are similar or related.
|
// arguments for the overloadings are similar or related.
|
|
|
extern "C" int printf (const char *, ...);
|
extern "C" int printf (const char *, ...);
|
|
|
int proper_method_called = 0;
|
int proper_method_called = 0;
|
|
|
struct base {
|
struct base {
|
int member;
|
int member;
|
virtual void method (char)
|
virtual void method (char)
|
{
|
{
|
}
|
}
|
virtual void method (char *)
|
virtual void method (char *)
|
{
|
{
|
}
|
}
|
};
|
};
|
|
|
struct derived : public base {
|
struct derived : public base {
|
int member;
|
int member;
|
virtual void method (char)
|
virtual void method (char)
|
{
|
{
|
}
|
}
|
virtual void method (char *)
|
virtual void method (char *)
|
{
|
{
|
proper_method_called++;
|
proper_method_called++;
|
}
|
}
|
};
|
};
|
|
|
char *message;
|
char *message;
|
|
|
int main ()
|
int main ()
|
{
|
{
|
derived derived_object;
|
derived derived_object;
|
|
|
derived_object.method (message);
|
derived_object.method (message);
|
|
|
if (proper_method_called != 1)
|
if (proper_method_called != 1)
|
{ printf ("FAIL\n"); return 1; }
|
{ printf ("FAIL\n"); return 1; }
|
else
|
else
|
printf ("PASS\n");
|
printf ("PASS\n");
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.