URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 107 |
Rev 1765 |
/* Test long long expression; test printing in general.
|
/* Test long long expression; test printing in general.
|
*
|
*
|
* /CLO/BUILD_ENV/Exports/cc -g +e -o long_long long_long.c
|
* /CLO/BUILD_ENV/Exports/cc -g +e -o long_long long_long.c
|
*
|
*
|
* or
|
* or
|
*
|
*
|
* cc +e +DA2.0 -g -o long_long long_long.c
|
* cc +e +DA2.0 -g -o long_long long_long.c
|
*/
|
*/
|
|
|
#ifdef PROTOTYPES
|
#ifdef PROTOTYPES
|
long long callee(long long i)
|
long long callee(long long i)
|
#else
|
#else
|
long long callee( i )
|
long long callee( i )
|
long long i;
|
long long i;
|
#endif
|
#endif
|
{
|
{
|
register long long result;
|
register long long result;
|
|
|
result = 0x12345678;
|
result = 0x12345678;
|
result = result << i;
|
result = result << i;
|
result += 0x9abcdef0;
|
result += 0x9abcdef0;
|
|
|
return result;
|
return result;
|
}
|
}
|
|
|
int known_types()
|
int known_types()
|
{
|
{
|
long long bin = 0, oct = 0, dec = 0, hex = 0;
|
long long bin = 0, oct = 0, dec = 0, hex = 0;
|
|
|
/* Known values, filling the full 64 bits.
|
/* Known values, filling the full 64 bits.
|
*/
|
*/
|
bin = 0x123456789abcdefLL; /* 64 bits = 16 hex digits */
|
bin = 0x123456789abcdefLL; /* 64 bits = 16 hex digits */
|
oct = 01234567123456701234567LL; /* = 21+ octal digits */
|
oct = 01234567123456701234567LL; /* = 21+ octal digits */
|
dec = 12345678901234567890ULL; /* = 19+ decimal digits */
|
dec = 12345678901234567890ULL; /* = 19+ decimal digits */
|
|
|
/* Stop here and look!
|
/* Stop here and look!
|
*/
|
*/
|
hex = bin - dec | oct;
|
hex = bin - dec | oct;
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
int main() {
|
int main() {
|
|
|
register long long x, y;
|
register long long x, y;
|
register long long i;
|
register long long i;
|
|
|
x = (long long) 0xfedcba9876543210LL;
|
x = (long long) 0xfedcba9876543210LL;
|
y = x++;
|
y = x++;
|
x +=y;
|
x +=y;
|
i = 11;
|
i = 11;
|
x = callee( i );
|
x = callee( i );
|
y += x;
|
y += x;
|
|
|
known_types();
|
known_types();
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
|
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.