URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 384 |
/* We used to crash in ccp here, because the initial constant value of 2
|
/* We used to crash in ccp here, because the initial constant value of 2
|
was changed to 5. */
|
was changed to 5. */
|
|
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "-O2 -fdump-tree-optimized" } */
|
/* { dg-options "-O2 -fdump-tree-optimized" } */
|
|
|
static const int a = 2;
|
static const int a = 2;
|
|
|
int test (int param)
|
int test (int param)
|
{
|
{
|
int *p = (int *) &a;
|
int *p = (int *) &a;
|
|
|
if (param)
|
if (param)
|
*p = 5;
|
*p = 5;
|
|
|
return a;
|
return a;
|
}
|
}
|
|
|
/* Check that we return the correct (unchanged) value. */
|
/* Check that we return the correct (unchanged) value. */
|
|
|
/* { dg-final { scan-tree-dump-times "return 2" 1 "optimized" } } */
|
/* { dg-final { scan-tree-dump-times "return 2" 1 "optimized" } } */
|
/* { dg-final { scan-tree-dump-times "return 5" 0 "optimized" } } */
|
/* { dg-final { scan-tree-dump-times "return 5" 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.