URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 318 |
Rev 384 |
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "-O2" } */
|
/* { dg-options "-O2" } */
|
|
|
extern void abort (void);
|
extern void abort (void);
|
|
|
int __attribute__ ((noinline))
|
int __attribute__ ((noinline))
|
test (unsigned int *a, int b)
|
test (unsigned int *a, int b)
|
{
|
{
|
return b ? 1 : __builtin_parity (*a);
|
return b ? 1 : __builtin_parity (*a);
|
}
|
}
|
|
|
int __attribute__ ((noinline))
|
int __attribute__ ((noinline))
|
testl (unsigned long *a, int b)
|
testl (unsigned long *a, int b)
|
{
|
{
|
return b ? 1 : __builtin_parityl (*a);
|
return b ? 1 : __builtin_parityl (*a);
|
}
|
}
|
|
|
int __attribute__ ((noinline))
|
int __attribute__ ((noinline))
|
testll (unsigned long long *a, int b)
|
testll (unsigned long long *a, int b)
|
{
|
{
|
return b ? 1 : __builtin_parityll (*a);
|
return b ? 1 : __builtin_parityll (*a);
|
}
|
}
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
unsigned int a = 0;
|
unsigned int a = 0;
|
unsigned long al;
|
unsigned long al;
|
unsigned long long all;
|
unsigned long long all;
|
|
|
a = 0x12345670;
|
a = 0x12345670;
|
if (test (&a, 0))
|
if (test (&a, 0))
|
abort ();
|
abort ();
|
|
|
al = 0x12345670ul;
|
al = 0x12345670ul;
|
if (testl (&al, 0))
|
if (testl (&al, 0))
|
abort();
|
abort();
|
|
|
#if 1
|
#if 1
|
all = 0x12345678abcdef0ull;
|
all = 0x12345678abcdef0ull;
|
if (testll (&all, 0))
|
if (testll (&all, 0))
|
abort ();
|
abort ();
|
#endif
|
#endif
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.