URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do run }
|
// { dg-do run }
|
// GROUPS passed temps
|
// GROUPS passed temps
|
// Date: Tue, 22 Mar 94 12:46:28 +0100
|
// Date: Tue, 22 Mar 94 12:46:28 +0100
|
// From: dak@pool.informatik.rwth-aachen.de
|
// From: dak@pool.informatik.rwth-aachen.de
|
// Message-Id: <9403221146.AA07815@messua>
|
// Message-Id: <9403221146.AA07815@messua>
|
// Subject: Bad code for pointer to member use as reference in g++ 2.5.8
|
// Subject: Bad code for pointer to member use as reference in g++ 2.5.8
|
|
|
#include
|
#include
|
struct str {
|
struct str {
|
int i;
|
int i;
|
} xxx = {0};
|
} xxx = {0};
|
|
|
int& test(str *arg1, int str::*arg2)
|
int& test(str *arg1, int str::*arg2)
|
{
|
{
|
return (arg1->*arg2);
|
return (arg1->*arg2);
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
test(&xxx, &str::i) = 5;
|
test(&xxx, &str::i) = 5;
|
if (xxx.i == 0)
|
if (xxx.i == 0)
|
{ 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.