OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr37924.c] - Blame information for rev 297

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* PR c/37924 */
2
 
3
extern void abort (void);
4
 
5
signed char a;
6
unsigned char b;
7
 
8
int
9
test1 (void)
10
{
11
  int c = -1;
12
  return ((unsigned int) (a ^ c)) >> 9;
13
}
14
 
15
int
16
test2 (void)
17
{
18
  int c = -1;
19
  return ((unsigned int) (b ^ c)) >> 9;
20
}
21
 
22
int
23
main (void)
24
{
25
  a = 0;
26
  if (test1 () != (-1U >> 9))
27
    abort ();
28
  a = 0x40;
29
  if (test1 () != (-1U >> 9))
30
    abort ();
31
  a = 0x80;
32
  if (test1 () != (a < 0) ? 0 : (-1U >> 9))
33
    abort ();
34
  a = 0xff;
35
  if (test1 () != (a < 0) ? 0 : (-1U >> 9))
36
    abort ();
37
  b = 0;
38
  if (test2 () != (-1U >> 9))
39
    abort ();
40
  b = 0x40;
41
  if (test2 () != (-1U >> 9))
42
    abort ();
43
  b = 0x80;
44
  if (test2 () != (-1U >> 9))
45
    abort ();
46
  b = 0xff;
47
  if (test2 () != (-1U >> 9))
48
    abort ();
49
  return 0;
50
}

powered by: WebSVN 2.1.0

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