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/] [20020614-1.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* PR c/6677 */
2
/* Verify that GCC doesn't perform illegal simplifications
3
   when folding constants.  */
4
 
5
#include <limits.h>
6
 
7
extern void abort (void);
8
extern void exit (int);
9
 
10
int main (void)
11
{
12
  int i;
13
  signed char j;
14
  unsigned char k;
15
 
16
  i = SCHAR_MAX;
17
 
18
  j = ((signed char) (i << 1)) / 2;
19
 
20
  if (j != -1)
21
    abort();
22
 
23
  j = ((signed char) (i * 2)) / 2;
24
 
25
  if (j != -1)
26
    abort();
27
 
28
  i = UCHAR_MAX;
29
 
30
  k = ((unsigned char) (i << 1)) / 2;
31
 
32
  if (k != UCHAR_MAX/2)
33
    abort();
34
 
35
  k = ((unsigned char) (i * 2)) / 2;
36
 
37
  if (k != UCHAR_MAX/2)
38
    abort();
39
 
40
  exit(0);
41
}

powered by: WebSVN 2.1.0

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