OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [920501-9.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
#include <stdio.h>
2
 
3
long long proc1(){return 1LL;}
4
long long proc2(){return 0x12345678LL;}
5
long long proc3(){return 0xaabbccdd12345678LL;}
6
long long proc4(){return -1LL;}
7
long long proc5(){return 0xaabbccddLL;}
8
 
9
print_longlong(x,buf)
10
     long long x;
11
     char *buf;
12
{
13
  unsigned long l;
14
  l= (x >> 32) & 0xffffffff;
15
  if (l != 0)
16
    sprintf(buf,"%lx%08.lx",l,((unsigned long)x & 0xffffffff));
17
  else
18
    sprintf(buf,"%lx",((unsigned long)x & 0xffffffff));
19
}
20
 
21
main(){char buf[100];
22
print_longlong(proc1(),buf);if(strcmp("1",buf))abort();
23
print_longlong(proc2(),buf);if(strcmp("12345678",buf))abort();
24
print_longlong(proc3(),buf);if(strcmp("aabbccdd12345678",buf))abort();
25
print_longlong(proc4(),buf);if(strcmp("ffffffffffffffff",buf))abort();
26
print_longlong(proc5(),buf);if(strcmp("aabbccdd",buf))abort();
27
exit(0);}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.