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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [20050922-2.c] - Blame information for rev 708

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

Line No. Rev Author Line
1 689 jeremybenn
/* 20050922-1.c does not trigger the expand_shift rotate bug on sh4-elf, but
2
   this does.  */
3
 
4
/* { dg-do run } */
5
/* { dg-options "-O1 -std=c99" } */
6
 
7
#include <stdlib.h>
8
 
9
#if __INT_MAX__ == 2147483647
10
typedef unsigned int uint32_t;
11
#elif __LONG_MAX__ == 2147483647
12
typedef unsigned long uint32_t;
13
#else
14
#error unable to find 32-bit integer type
15
#endif
16
 
17
#define rotl(x,n)   (((x) << ((int)(n))) | ((x) >> (32 - (int)(n))))
18
 
19
uint32_t
20
f (uint32_t a, uint32_t b)
21
{
22
 
23
  b = rotl (a, b & 31);
24
  return b;
25
}
26
 
27
int
28
main ()
29
{
30
  if (f(2,31) != 1)
31
    abort ();
32
  exit (0);
33
}

powered by: WebSVN 2.1.0

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