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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20020508-2.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 <limits.h>
2
 
3
#ifndef CHAR_BIT
4
#define CHAR_BIT 8
5
#endif
6
 
7
#define ROR(a,b) (((a) >> (b)) | ((a) << ((sizeof (a) * CHAR_BIT) - (b))))
8
#define ROL(a,b) (((a) << (b)) | ((a) >> ((sizeof (a) * CHAR_BIT) - (b))))
9
 
10
#define CHAR_VALUE ((char)0x1234)
11
#define SHORT_VALUE ((short)0x1234)
12
#define INT_VALUE ((int)0x1234)
13
#define LONG_VALUE ((long)0x12345678L)
14
#define LL_VALUE ((long long)0x12345678abcdef0LL)
15
 
16
#define SHIFT1 4
17
#define SHIFT2 ((sizeof (long long) * CHAR_BIT) - SHIFT1)
18
 
19
char c = CHAR_VALUE;
20
short s = SHORT_VALUE;
21
int i = INT_VALUE;
22
long l = LONG_VALUE;
23
long long ll = LL_VALUE;
24
int shift1 = SHIFT1;
25
int shift2 = SHIFT2;
26
 
27
main ()
28
{
29
  if (ROR (c, shift1) != ROR (CHAR_VALUE, SHIFT1))
30
    abort ();
31
 
32
  if (ROR (c, SHIFT1) != ROR (CHAR_VALUE, SHIFT1))
33
    abort ();
34
 
35
  if (ROR (s, shift1) != ROR (SHORT_VALUE, SHIFT1))
36
    abort ();
37
 
38
  if (ROR (s, SHIFT1) != ROR (SHORT_VALUE, SHIFT1))
39
    abort ();
40
 
41
  if (ROR (i, shift1) != ROR (INT_VALUE, SHIFT1))
42
    abort ();
43
 
44
  if (ROR (i, SHIFT1) != ROR (INT_VALUE, SHIFT1))
45
    abort ();
46
 
47
  if (ROR (l, shift1) != ROR (LONG_VALUE, SHIFT1))
48
    abort ();
49
 
50
  if (ROR (l, SHIFT1) != ROR (LONG_VALUE, SHIFT1))
51
    abort ();
52
 
53
  if (ROR (ll, shift1) != ROR (LL_VALUE, SHIFT1))
54
    abort ();
55
 
56
  if (ROR (ll, SHIFT1) != ROR (LL_VALUE, SHIFT1))
57
    abort ();
58
 
59
  if (ROR (ll, shift2) != ROR (LL_VALUE, SHIFT2))
60
    abort ();
61
 
62
  if (ROR (ll, SHIFT2) != ROR (LL_VALUE, SHIFT2))
63
    abort ();
64
 
65
  if (ROL (c, shift1) != ROL (CHAR_VALUE, SHIFT1))
66
    abort ();
67
 
68
  if (ROL (c, SHIFT1) != ROL (CHAR_VALUE, SHIFT1))
69
    abort ();
70
 
71
  if (ROL (s, shift1) != ROL (SHORT_VALUE, SHIFT1))
72
    abort ();
73
 
74
  if (ROL (s, SHIFT1) != ROL (SHORT_VALUE, SHIFT1))
75
    abort ();
76
 
77
  if (ROL (i, shift1) != ROL (INT_VALUE, SHIFT1))
78
    abort ();
79
 
80
  if (ROL (i, SHIFT1) != ROL (INT_VALUE, SHIFT1))
81
    abort ();
82
 
83
  if (ROL (l, shift1) != ROL (LONG_VALUE, SHIFT1))
84
    abort ();
85
 
86
  if (ROL (l, SHIFT1) != ROL (LONG_VALUE, SHIFT1))
87
    abort ();
88
 
89
  if (ROL (ll, shift1) != ROL (LL_VALUE, SHIFT1))
90
    abort ();
91
 
92
  if (ROL (ll, SHIFT1) != ROL (LL_VALUE, SHIFT1))
93
    abort ();
94
 
95
  if (ROL (ll, shift2) != ROL (LL_VALUE, SHIFT2))
96
    abort ();
97
 
98
  if (ROL (ll, SHIFT2) != ROL (LL_VALUE, SHIFT2))
99
    abort ();
100
 
101
  exit (0);
102
}

powered by: WebSVN 2.1.0

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