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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [Wjump-misses-init-1.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-Wjump-misses-init" } */
3
int
4
f1 (int a)
5
{
6
  if (a > 0)
7
    {
8
      int i = 7;        /* { dg-message "here" } */
9
    lab:                /* { dg-message "here" } */
10
      return a;
11
    }
12
  else
13
    {
14
      if (a < 0)
15
        goto lab;       /* { dg-warning "jump" } */
16
      return 1;
17
    }
18
}
19
 
20
int
21
f2 (int a)
22
{
23
  if (a > 0)
24
    {
25
      if (a < 0)
26
        goto lab;       /* { dg-warning "jump" } */
27
      return 1;
28
    }
29
  else
30
    {
31
      int i = 7;        /* { dg-message "here" } */
32
    lab:                /* { dg-message "here" } */
33
      return a;
34
    }
35
}
36
 
37
int
38
f3 (int a)
39
{
40
  if (a > 0)
41
    {
42
      static int i = 7;
43
    lab:
44
      return a;
45
    }
46
  else
47
    {
48
      if (a < 0)
49
        goto lab;
50
      return 1;
51
    }
52
}
53
 
54
int
55
f4 (int a)
56
{
57
  if (a > 0)
58
    {
59
      if (a < 0)
60
        goto lab;
61
      return 1;
62
    }
63
  else
64
    {
65
      static int i = 7;
66
    lab:
67
      return a;
68
    }
69
}
70
 
71
int
72
f5 (int a)
73
{
74
  if (a > 0)
75
    {
76
      int b = 1;
77
      if (a < 0)
78
        goto lab;
79
    }
80
 lab:
81
  return a;
82
}
83
 
84
int
85
f6 (int a)
86
{
87
  if (a > 0)
88
    {
89
    lab:
90
      return a;
91
    }
92
  else
93
    {
94
      int b = 1;
95
      goto lab;
96
    }
97
}
98
 
99
int
100
f7 (int a)
101
{
102
  switch (a)            /* { dg-message "switch" } */
103
    {
104
      int b = 1;        /* { dg-message "here" } */
105
 
106
    case 1:             /* { dg-warning "jump" } */
107
      return a;
108
    }
109
}
110
 
111
int
112
f8 (int a)
113
{
114
  switch (a)            /* { dg-message "switch" } */
115
    {
116
      int b = 1;        /* { dg-message "here" } */
117
 
118
    case 1:             /* { dg-warning "jump" } */
119
      goto lab;
120
    }
121
 lab:
122
  return a;
123
}
124
 
125
int
126
f9 (int a)
127
{
128
  switch (a)
129
    {
130
    case 0:
131
      {
132
        int b = 1;
133
        return b;
134
      }
135
    case 1:
136
      return a;
137
    }
138
}
139
 
140
int
141
f10 (int a)
142
{
143
  switch (a)
144
    {
145
    case 0:
146
      {
147
        int b = 1;
148
        goto lab;
149
      }
150
 
151
    case 1:
152
      goto lab;
153
    }
154
 lab:
155
  return a;
156
}

powered by: WebSVN 2.1.0

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