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/] [ffs-2.c] - Blame information for rev 823

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

Line No. Rev Author Line
1 149 jeremybenn
struct
2
  {
3
    int input;
4
    int output;
5
  }
6
ffstesttab[] =
7
  {
8
#if __INT_MAX__ >= 2147483647
9
    /* at least 32-bit integers */
10
    { 0x80000000, 32 },
11
    { 0xa5a5a5a5, 1 },
12
    { 0x5a5a5a5a, 2 },
13
    { 0xcafe0000, 18 },
14
#endif
15
#if __INT_MAX__ >= 32767
16
    /* at least 16-bit integers */
17
    { 0x8000, 16 },
18
    { 0xa5a5, 1 },
19
    { 0x5a5a, 2 },
20
    { 0x0ca0, 6 },
21
#endif
22
#if __INT_MAX__ < 32767
23
#error integers are too small
24
#endif
25
  };
26
 
27
#define NFFSTESTS (sizeof (ffstesttab) / sizeof (ffstesttab[0]))
28
 
29
extern void abort (void);
30
extern void exit (int);
31
 
32
int
33
main (void)
34
{
35
  int i;
36
 
37
  for (i = 0; i < NFFSTESTS; i++)
38
    {
39
      if (__builtin_ffs (ffstesttab[i].input) != ffstesttab[i].output)
40
        abort ();
41
    }
42
 
43
  exit (0);
44
}

powered by: WebSVN 2.1.0

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