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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20030222-1.c] - Blame information for rev 841

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

Line No. Rev Author Line
1 149 jeremybenn
/* Verify that we get the low part of the long long as an int.  We
2
   used to get it wrong on big-endian machines, if register allocation
3
   succeeded at all.  We use volatile to make sure the long long is
4
   actually truncated to int, in case a single register is wide enough
5
   for a long long.  */
6
 
7
#include <limits.h>
8
 
9
void
10
ll_to_int (long long x, volatile int *p)
11
{
12
  int i;
13
  asm ("" : "=r" (i) : "0" (x));
14
  *p = i;
15
}
16
 
17
int val = INT_MIN + 1;
18
 
19
int main() {
20
  volatile int i;
21
 
22
  ll_to_int ((long long)val, &i);
23
  if (i != val)
24
    abort ();
25
 
26
  exit (0);
27
}

powered by: WebSVN 2.1.0

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