URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 301 |
Rev 384 |
/* { dg-options "-mthumb" { target arm*-*-* } } */
|
/* { dg-options "-mthumb" { target arm*-*-* } } */
|
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-timeout 100 } */
|
/* { dg-timeout 100 } */
|
|
|
/* PR middle-end/39378 */
|
/* PR middle-end/39378 */
|
/* Check if the thunk target function is emitted correctly. */
|
/* Check if the thunk target function is emitted correctly. */
|
class B1
|
class B1
|
{
|
{
|
public:
|
public:
|
virtual int foo1(void);
|
virtual int foo1(void);
|
int b1;
|
int b1;
|
};
|
};
|
|
|
class B2
|
class B2
|
{
|
{
|
public:
|
public:
|
virtual int foo2 (void);
|
virtual int foo2 (void);
|
int b2;
|
int b2;
|
};
|
};
|
|
|
class D : public B1, public B2
|
class D : public B1, public B2
|
{
|
{
|
int foo1(void);
|
int foo1(void);
|
int foo2(void);
|
int foo2(void);
|
int d;
|
int d;
|
};
|
};
|
|
|
int B1::foo1(void)
|
int B1::foo1(void)
|
{
|
{
|
return 3;
|
return 3;
|
}
|
}
|
|
|
int B2::foo2(void)
|
int B2::foo2(void)
|
{
|
{
|
return 4;
|
return 4;
|
}
|
}
|
|
|
int D::foo1(void)
|
int D::foo1(void)
|
{
|
{
|
return 1;
|
return 1;
|
}
|
}
|
|
|
int D::foo2(void)
|
int D::foo2(void)
|
{
|
{
|
return 2;
|
return 2;
|
}
|
}
|
|
|
__attribute__((noinline)) int test(B2* bp)
|
__attribute__((noinline)) int test(B2* bp)
|
{
|
{
|
return bp->foo2();
|
return bp->foo2();
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
B2 *bp = new D();
|
B2 *bp = new D();
|
if (test(bp) == 2)
|
if (test(bp) == 2)
|
return 0;
|
return 0;
|
else
|
else
|
return 1;
|
return 1;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.