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 }
|
// prms-id: 786
|
// prms-id: 786
|
|
|
extern "C" int printf (const char *, ...);
|
extern "C" int printf (const char *, ...);
|
extern "C" void exit(int);
|
extern "C" void exit(int);
|
class C
|
class C
|
{
|
{
|
int a;
|
int a;
|
public:
|
public:
|
C() {a = 1;}
|
C() {a = 1;}
|
};
|
};
|
|
|
void func(const C& a, C& b)
|
void func(const C& a, C& b)
|
{
|
{
|
printf ("in const func\n");
|
printf ("in const func\n");
|
exit(1);
|
exit(1);
|
}
|
}
|
|
|
void func(C& a, C& b)
|
void func(C& a, C& b)
|
{
|
{
|
printf ("in non-const func\n");
|
printf ("in non-const func\n");
|
}
|
}
|
|
|
void testit(const C& a, C& b)
|
void testit(const C& a, C& b)
|
{
|
{
|
func(a,b);
|
func(a,b);
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
C a;
|
C a;
|
C b;
|
C b;
|
|
|
func(a,b);
|
func(a,b);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.