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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [960311-3.c] - Blame information for rev 307

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

Line No. Rev Author Line
1 297 jeremybenn
#include <stdio.h>
2
 
3
#ifdef DEBUG
4
#define abort() printf ("error, line %d\n", __LINE__)
5
#endif
6
 
7
int count;
8
 
9
void a1() { ++count; }
10
 
11
void
12
b (unsigned long data)
13
{
14
  if (data & 0x80000000) a1();
15
  data <<= 1;
16
 
17
  if (data & 0x80000000) a1();
18
  data <<= 1;
19
 
20
  if (data & 0x80000000) a1();
21
}
22
 
23
main ()
24
{
25
  count = 0;
26
  b (0);
27
  if (count != 0)
28
    abort ();
29
 
30
  count = 0;
31
  b (0x80000000);
32
  if (count != 1)
33
    abort ();
34
 
35
  count = 0;
36
  b (0x40000000);
37
  if (count != 1)
38
    abort ();
39
 
40
  count = 0;
41
  b (0x20000000);
42
  if (count != 1)
43
    abort ();
44
 
45
  count = 0;
46
  b (0xc0000000);
47
  if (count != 2)
48
    abort ();
49
 
50
  count = 0;
51
  b (0xa0000000);
52
  if (count != 2)
53
    abort ();
54
 
55
  count = 0;
56
  b (0x60000000);
57
  if (count != 2)
58
    abort ();
59
 
60
  count = 0;
61
  b (0xe0000000);
62
  if (count != 3)
63
    abort ();
64
 
65
#ifdef DEBUG
66
  printf ("Done.\n");
67
#endif
68
  exit (0);
69
}

powered by: WebSVN 2.1.0

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