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 }
|
// { dg-options "-O" }
|
// { dg-options "-O" }
|
// GROUPS passed code-generation
|
// GROUPS passed code-generation
|
// Options: -O
|
// Options: -O
|
//
|
//
|
// Check that when an int value is assigned to a short int, the proper
|
// Check that when an int value is assigned to a short int, the proper
|
// half of the int (i.e. the low order half) ends up in the short.
|
// half of the int (i.e. the low order half) ends up in the short.
|
//
|
//
|
// This fails with 1.32.0 with -O and f1() is inline.
|
// This fails with 1.32.0 with -O and f1() is inline.
|
//
|
//
|
// Workaround - declare "f1_arg" as type "short int".
|
// Workaround - declare "f1_arg" as type "short int".
|
|
|
#include
|
#include
|
#include
|
#include
|
|
|
short int v2;
|
short int v2;
|
|
|
long v1 = 0x11117777;
|
long v1 = 0x11117777;
|
|
|
inline void f1 (long f1_arg)
|
inline void f1 (long f1_arg)
|
{
|
{
|
v2 = f1_arg;
|
v2 = f1_arg;
|
}
|
}
|
|
|
int main ()
|
int main ()
|
{
|
{
|
f1 (v1);
|
f1 (v1);
|
|
|
if (v2 != 0x00007777)
|
if (v2 != 0x00007777)
|
abort ();
|
abort ();
|
else
|
else
|
printf ("PASS\n");
|
printf ("PASS\n");
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.