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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr41555.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-std=c99" } */
3
 
4
#include <stdint.h>
5
#include <limits.h>
6
 
7
extern void abort (void);
8
 
9
static uint64_t safe_div_func_uint64_t_u_u (uint64_t _ui1, uint64_t _ui2)
10
{
11
  if (_ui2==0) return _ui1;
12
  return _ui1 / _ui2;
13
}
14
 
15
static int64_t safe_div_func_int64_t_s_s (int64_t _si1, int64_t _si2)
16
{
17
  if (_si2==0 || (_si1==INT64_MIN && _si2==-1)) return _si1;
18
  return _si1 / _si2;
19
}
20
 
21
#define safe_add_macro_int8_t_s_s(si1,si2) \
22
                ((((((int8_t)(si1))>((int8_t)0)) && (((int8_t)(si2))>((int8_t)0)) && (((int8_t)(si1)) > ((INT8_MAX)-((int8_t)(si2))))) \
23
                  || ((((int8_t)(si1))<((int8_t)0)) && (((int8_t)(si2))<((int8_t)0)) && (((int8_t)(si1)) < ((INT8_MIN)-((int8_t)(si2)))))) \
24
                 ? ((int8_t)(si1)) \
25
                 : (((int8_t)(si1)) + ((int8_t)(si2))) \
26
                 )
27
 
28
static int8_t
29
safe_add_func_int8_t_s_s(int8_t _si1, int8_t _si2)
30
{
31
  return safe_add_macro_int8_t_s_s(_si1,_si2);
32
}
33
 
34
#define safe_rshift_macro_uint64_t_u_s(left,right) \
35
        (((((int)(right)) < ((uint64_t)0)) \
36
                         || (((int)(right)) >= sizeof(uint64_t)*CHAR_BIT)) \
37
                        ? ((uint64_t)(left)) \
38
                        : (((uint64_t)(left)) >> ((int)(right))))
39
 
40
static uint64_t
41
safe_rshift_func_uint64_t_u_s(uint64_t _left, int _right)
42
{
43
  return safe_rshift_macro_uint64_t_u_s(_left,_right);
44
}
45
 
46
#define safe_mul_macro_int32_t_s_s(si1,si2) \
47
  ((((((int32_t)(si1)) > ((int32_t)0)) && (((int32_t)(si2)) > ((int32_t)0)) && (((int32_t)(si1)) > ((INT32_MAX) / ((int32_t)(si2))))) || \
48
  ((((int32_t)(si1)) > ((int32_t)0)) && (((int32_t)(si2)) <= ((int32_t)0)) && (((int32_t)(si2)) < ((INT32_MIN) / ((int32_t)(si1))))) || \
49
  ((((int32_t)(si1)) <= ((int32_t)0)) && (((int32_t)(si2)) > ((int32_t)0)) && (((int32_t)(si1)) < ((INT32_MIN) / ((int32_t)(si2))))) || \
50
  ((((int32_t)(si1)) <= ((int32_t)0)) && (((int32_t)(si2)) <= ((int32_t)0)) && (((int32_t)(si1)) != ((int32_t)0)) && (((int32_t)(si2)) < ((INT32_MAX) / ((int32_t)(si1)))))) \
51
  ? ((int32_t)(si1)) \
52
  : ((int32_t)(si1)) * ((int32_t)(si2)))
53
 
54
static int32_t
55
safe_mul_func_int32_t_s_s (int32_t _si1, int32_t _si2)
56
{
57
  return safe_mul_macro_int32_t_s_s(_si1,_si2);
58
}
59
 
60
static int8_t g_39;
61
static volatile uint8_t g_46;
62
static uint8_t g_47;
63
static uint8_t *g_62;
64
static uint8_t g_79;
65
static int8_t g_101 = -1L;
66
static uint8_t *g_114;
67
static uint8_t *g_126;
68
static uint8_t g_133;
69
 
70
static uint16_t func_35 (int32_t * p_36, uint64_t p_37, uint32_t p_38);
71
static uint16_t func_35 (int32_t * p_36, uint64_t p_37, uint32_t p_38)
72
{
73
  if (g_62 != 0)
74
    abort ();
75
  for (g_39 = 1; g_39 < 0; g_39 = 1)
76
    {
77
    }
78
  return 1;
79
}
80
 
81
static int32_t func_19 (int32_t p_20);
82
static int32_t func_19 (int32_t p_20)
83
{
84
  if (1 !=
85
      safe_div_func_uint64_t_u_u ((safe_div_func_int64_t_s_s (p_20, 1)),
86
                                  g_101))
87
    {
88
      func_35 (0, 1 <= (safe_add_func_int8_t_s_s (g_47, g_46)) > p_20 < 1, 1);
89
      g_133 = 1;
90
      if (g_114 != 0)
91
        abort ();
92
      if (g_126 != 0)
93
        abort ();
94
    }
95
  return 1;
96
}
97
 
98
static uint8_t func_2 (int32_t p_6);
99
static uint8_t func_2 (int32_t p_6)
100
{
101
  for (1; p_6 > 1; 1)
102
    return 0;
103
  func_19 (g_79);
104
  if (safe_mul_func_int32_t_s_s
105
      ((0, 1 < (safe_rshift_func_uint64_t_u_s (1 ^ p_6, 1))),
106
       (func_35 (&p_6, 1, 1) < 1)))
107
    {
108
    }
109
  return 1;
110
}
111
 
112
int main (void)
113
{
114
  func_2 (1);
115
  if (g_133 != 1)
116
    abort ();
117
  return 0;
118
}
119
 

powered by: WebSVN 2.1.0

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