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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [uninit-5.c] - Blame information for rev 823

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

Line No. Rev Author Line
1 149 jeremybenn
/* Spurious uninitialized-variable warnings.  */
2
 
3
/* { dg-do compile } */
4
/* { dg-options "-O -Wuninitialized" } */
5
 
6
extern void use(int);
7
extern void foo(void);
8
 
9
void
10
func1(int cond)
11
{
12
    int x;  /* { dg-bogus "x" "uninitialized variable warning" } */
13
 
14
    if(cond)
15
        x = 1;
16
 
17
    foo();
18
 
19
    if(cond)
20
        use(x);
21
}
22
 
23
void
24
func2 (int cond)
25
{
26
    int x;  /* { dg-bogus "x" "uninitialized variable warning" } */
27
    int flag = 0;
28
 
29
    if(cond)
30
    {
31
        x = 1;
32
        flag = 1;
33
    }
34
 
35
    foo();
36
 
37
    if(flag)
38
        use(x);
39
}

powered by: WebSVN 2.1.0

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