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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [Wjump-misses-init-2.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-Wjump-misses-init -std=c99" } */
3
extern void f1 ();
4
int
5
f2 (int a)
6
{
7
  switch (a)            /* { dg-message "switch" } */
8
    {
9
    case 1:
10
      f1 ();
11
      int v2 = 3;       /* { dg-message "here" } */
12
    case 2:             /* { dg-warning "jump" } */
13
      if (v2 == 7)
14
        f1 ();
15
    }
16
  return 0;
17
}
18
 
19
int
20
f3 (int i)
21
{
22
  if (i)
23
    goto bad;           /* { dg-warning "jump" } */
24
  int a = f2 (i);       /* { dg-message "here" } */
25
 bad:                   /* { dg-message "here" } */
26
  return a;
27
}
28
 
29
int
30
f4 (int a)
31
{
32
  switch (a)
33
    {
34
    case 1:
35
      f1 ();
36
      static int v2 = 3;
37
    case 2:
38
      if (v2 == 7)
39
        f1 ();
40
    }
41
  return 0;
42
}
43
 
44
int
45
f5 (int i)
46
{
47
  if (i)
48
    goto bad;
49
  static int a = 6;
50
 bad:
51
  return a;
52
}

powered by: WebSVN 2.1.0

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