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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [uninit-4-O0.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Spurious uninit variable warnings, case 4.
2
   Simplified version of cppexp.c (cpp_parse_expr).
3
 
4
   This one is really fragile, it gets it right if you take out case
5
   1, or if the structure is replaced by an int, or if the structure
6
   has fewer members (!) */
7
 
8
/* { dg-do compile } */
9
/* { dg-options "-Wuninitialized" } */
10
 
11
extern void abort (void);
12
 
13
struct operation {
14
    short op;
15
    char rprio;
16
    char flags;
17
    char unsignedp;
18
    long value;
19
};
20
 
21
extern struct operation cpp_lex (void);
22
 
23
void
24
cpp_parse_expr (void)
25
{
26
  int rprio; /* { dg-bogus "rprio" "uninitialized variable warning PR19833" } */
27
  struct operation op;
28
 
29
  for (;;)
30
    {
31
      op = cpp_lex ();
32
 
33
      switch (op.op)
34
        {
35
        case 0:
36
          break;
37
        case 1:
38
          return;
39
        case 2:
40
          rprio = 1;
41
          break;
42
        default:
43
          return;
44
        }
45
 
46
      if (op.op == 0)
47
        return;
48
 
49
      if (rprio != 1)
50
        abort();
51
    }
52
}

powered by: WebSVN 2.1.0

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