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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O0 -Wuninitialized" } */
3
extern int bar (int);
4
extern void baz (int *);
5
 
6
int
7
foo (int i)
8
{
9
  int j; /* { dg-warning "'j' may be used uninitialized in this function" "uninitialized" { xfail *-*-* } 9 } */
10
 
11
  if (bar (i)) {
12
    baz (&j);
13
  } else {
14
  }
15
 
16
  return j;
17
}
18
 
19
 
20
int foo2( void ) {
21
  int rc;  /* { dg-warning "'rc' is used uninitialized in this function" "uninitialized" { xfail *-*-* } 21 } */
22
  return rc;
23
  *&rc = 0;
24
}
25
 
26
extern int printf(const char *, ...);
27
void frob(int *pi);
28
 
29
int main(void)
30
{
31
  int i;
32
  printf("i = %d\n", i); /* { dg-warning "'i' is used uninitialized in this function" "uninitialized" { xfail *-*-* } 32 } */
33
  frob(&i);
34
 
35
  return 0;
36
}
37
 
38
void foo3(int*);
39
void bar3(void) {
40
  int x;
41
  if(x) /* { dg-warning "'x' is used uninitialized in this function" "uninitialized" { xfail *-*-* } 41 } */
42
    foo3(&x);
43
}

powered by: WebSVN 2.1.0

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