URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "-O1 -fdump-tree-optimized" } */
|
/* { dg-options "-O1 -fdump-tree-optimized" } */
|
|
|
void link_error();
|
void link_error();
|
|
|
struct OOf {
|
struct OOf {
|
int value;
|
int value;
|
OOf() {value = 0;}
|
OOf() {value = 0;}
|
};
|
};
|
inline OOf operator+(OOf op1, OOf op2)
|
inline OOf operator+(OOf op1, OOf op2)
|
{
|
{
|
OOf f;
|
OOf f;
|
f.value = op1.value + op2.value;
|
f.value = op1.value + op2.value;
|
return f;
|
return f;
|
}
|
}
|
inline OOf operator*(OOf op1, OOf op2)
|
inline OOf operator*(OOf op1, OOf op2)
|
{
|
{
|
OOf f;
|
OOf f;
|
f.value = op1.value * op2.value;
|
f.value = op1.value * op2.value;
|
return f;
|
return f;
|
}
|
}
|
inline OOf operator-(OOf op1, OOf op2)
|
inline OOf operator-(OOf op1, OOf op2)
|
{
|
{
|
OOf f;
|
OOf f;
|
f.value = op1.value - op2.value;
|
f.value = op1.value - op2.value;
|
return f;
|
return f;
|
}
|
}
|
inline OOf test_func(
|
inline OOf test_func(
|
OOf a,
|
OOf a,
|
OOf b,
|
OOf b,
|
OOf c
|
OOf c
|
)
|
)
|
{
|
{
|
OOf d, e;
|
OOf d, e;
|
OOf result;
|
OOf result;
|
d = a * b + b * c;
|
d = a * b + b * c;
|
e = a * c - b * d;
|
e = a * c - b * d;
|
result = d * e;
|
result = d * e;
|
return result;
|
return result;
|
}
|
}
|
|
|
void test()
|
void test()
|
{
|
{
|
OOf a, b, c;
|
OOf a, b, c;
|
OOf d = test_func (a,b,c);
|
OOf d = test_func (a,b,c);
|
if (d.value)
|
if (d.value)
|
link_error();
|
link_error();
|
}
|
}
|
|
|
/* We should have removed the casts from pointers to references and caused SRA to happen. */
|
/* We should have removed the casts from pointers to references and caused SRA to happen. */
|
/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
|
/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized"} } */
|
/* { dg-final { cleanup-tree-dump "optimized" } } */
|
/* { dg-final { cleanup-tree-dump "optimized" } } */
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.