URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
/* Check that ACCs and ACCGs are treated as global variables even if
|
/* Check that ACCs and ACCGs are treated as global variables even if
|
media.h isn't included. */
|
media.h isn't included. */
|
/* { dg-do run } */
|
/* { dg-do run } */
|
extern void abort (void);
|
extern void abort (void);
|
extern void exit (int);
|
extern void exit (int);
|
|
|
void
|
void
|
set ()
|
set ()
|
{
|
{
|
#define SET(X) __MWTACC (X, (X) | 0x100), __MWTACCG (X, X)
|
#define SET(X) __MWTACC (X, (X) | 0x100), __MWTACCG (X, X)
|
SET (0);
|
SET (0);
|
SET (1);
|
SET (1);
|
SET (2);
|
SET (2);
|
SET (3);
|
SET (3);
|
#if defined (__CPU_FR450__)
|
#if defined (__CPU_FR450__)
|
SET (8);
|
SET (8);
|
SET (9);
|
SET (9);
|
SET (10);
|
SET (10);
|
SET (11);
|
SET (11);
|
#elif __FRV_ACC__ > 4
|
#elif __FRV_ACC__ > 4
|
SET (4);
|
SET (4);
|
SET (5);
|
SET (5);
|
SET (6);
|
SET (6);
|
SET (7);
|
SET (7);
|
#endif
|
#endif
|
#undef SET
|
#undef SET
|
}
|
}
|
|
|
void
|
void
|
check ()
|
check ()
|
{
|
{
|
int diff1, diff2;
|
int diff1, diff2;
|
|
|
diff1 = diff2 = 0;
|
diff1 = diff2 = 0;
|
|
|
#define CHECK(X) \
|
#define CHECK(X) \
|
(diff1 |= (__MRDACC (X) ^ (X | 0x100)), \
|
(diff1 |= (__MRDACC (X) ^ (X | 0x100)), \
|
diff2 |= (__MRDACCG (X) ^ X))
|
diff2 |= (__MRDACCG (X) ^ X))
|
CHECK (0);
|
CHECK (0);
|
CHECK (1);
|
CHECK (1);
|
CHECK (2);
|
CHECK (2);
|
CHECK (3);
|
CHECK (3);
|
#if defined (__CPU_FR450__)
|
#if defined (__CPU_FR450__)
|
CHECK (8);
|
CHECK (8);
|
CHECK (9);
|
CHECK (9);
|
CHECK (10);
|
CHECK (10);
|
CHECK (11);
|
CHECK (11);
|
#elif __FRV_ACC__ > 4
|
#elif __FRV_ACC__ > 4
|
CHECK (4);
|
CHECK (4);
|
CHECK (5);
|
CHECK (5);
|
CHECK (6);
|
CHECK (6);
|
CHECK (7);
|
CHECK (7);
|
#endif
|
#endif
|
#undef CHECK
|
#undef CHECK
|
if ((diff1 | diff2) != 0)
|
if ((diff1 | diff2) != 0)
|
abort ();
|
abort ();
|
}
|
}
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
set ();
|
set ();
|
check ();
|
check ();
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.