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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [uninit-pred-2_c.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 "-Wuninitialized -O2 -fno-tree-tail-merge" } */
3
 
4
int g;
5
void bar (void);
6
void blah (int);
7
 
8
int foo (int n, int m, int r)
9
{
10
  int flag = 0;
11
  int v;
12
 
13
  if (n)
14
    {
15
      v = r;
16
      flag = 1;
17
    }
18
 
19
  if (m) g++;
20
  else bar();
21
 
22
  if (flag)
23
    blah(v); /* { dg-bogus "uninitialized" "bogus uninitialized var warning" } */
24
 
25
  return 0;
26
}
27
 
28
int foo_2 (int n, int m, int r)
29
{
30
  int flag = 0;
31
  int v;
32
 
33
  if (n)
34
    {
35
      v = r;
36
      flag = 1;
37
    }
38
 
39
  if (m) g++;
40
  else bar();
41
 
42
  if (flag)
43
    blah(v); /* { dg-bogus "uninitialized" "bogus uninitialized var warning" } */
44
  else
45
    blah(v); /* { dg-warning "uninitialized" "real uninitialized var warning" } */
46
 
47
  return 0;
48
}

powered by: WebSVN 2.1.0

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