URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 816 |
Rev 826 |
/* PR middle-end/24003 */
|
/* PR middle-end/24003 */
|
/* Contributed by Eric Botcazou <ebotcazou@adacore.com> */
|
/* Contributed by Eric Botcazou <ebotcazou@adacore.com> */
|
|
|
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "-std=c99 -O -fno-inline" } */
|
/* { dg-options "-std=c99 -O -fno-inline" } */
|
/* { dg-options "-std=c99 -O -fno-inline -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
|
/* { dg-options "-std=c99 -O -fno-inline -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
|
|
|
#include <limits.h>
|
#include <limits.h>
|
|
|
typedef unsigned long uns32_t;
|
typedef unsigned long uns32_t;
|
typedef unsigned long long uns64_t;
|
typedef unsigned long long uns64_t;
|
|
|
extern void abort(void);
|
extern void abort(void);
|
|
|
uns32_t lo (uns64_t p)
|
uns32_t lo (uns64_t p)
|
{
|
{
|
return (uns32_t)p;
|
return (uns32_t)p;
|
}
|
}
|
|
|
uns64_t concat (uns32_t p1, uns32_t p2)
|
uns64_t concat (uns32_t p1, uns32_t p2)
|
{
|
{
|
#if LLONG_MAX > 2147483647L
|
#if LLONG_MAX > 2147483647L
|
return ((uns64_t)p1 << 32) | p2;
|
return ((uns64_t)p1 << 32) | p2;
|
#else
|
#else
|
return 0;
|
return 0;
|
#endif
|
#endif
|
}
|
}
|
|
|
uns64_t lshift32 (uns64_t p1, uns32_t p2)
|
uns64_t lshift32 (uns64_t p1, uns32_t p2)
|
{
|
{
|
return concat (lo (p1), p2);
|
return concat (lo (p1), p2);
|
}
|
}
|
|
|
int main(void)
|
int main(void)
|
{
|
{
|
#if LLONG_MAX > 2147483647L
|
#if LLONG_MAX > 2147483647L
|
if (lshift32 (0xFFFFFFFF12345678ULL, 0x90ABCDEFUL) != 0x1234567890ABCDEFULL)
|
if (lshift32 (0xFFFFFFFF12345678ULL, 0x90ABCDEFUL) != 0x1234567890ABCDEFULL)
|
abort ();
|
abort ();
|
#endif
|
#endif
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.