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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Positive test for uninitialized variables.  */
2
/* { dg-do compile } */
3
/* { dg-options "-Wuninitialized" } */
4
 
5
int sink;
6
 
7
void f1(int parm)       /* { dg-bogus "uninitialized" "parameter" } */
8
{
9
  sink = parm;          /* { dg-bogus "uninitialized" "parameter" } */
10
}
11
 
12
void f2(void)
13
{
14
  int x;
15
  sink = x;             /* { dg-warning "is used" "unconditional" } */
16
}
17
 
18
void f3(int p)
19
{
20
  int x;                /* { dg-warning "may be used" "conditional" { xfail *-*-* } } */
21
  if (p)
22
    x = p;
23
  sink = x;
24
}
25
 
26
void f4(int p)
27
{
28
  int x;                /* { dg-bogus "uninitialized" "easy if" } */
29
  if (p)
30
    x = 1;
31
  else
32
    x = 2;
33
  sink = x;
34
}
35
 
36
void f5(void)
37
{
38
  int x, i;             /* { dg-bogus "uninitialized" "easy loop" } */
39
  for (i = 0; i < 10; ++i)
40
    x = 1;
41
  sink = x;
42
}

powered by: WebSVN 2.1.0

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