2009-03-24 10:24:46 +08:00
|
|
|
// RUN: clang-cc -analyze -warn-dead-stores -warn-uninit-values -verify %s
|
2007-12-01 03:04:31 +08:00
|
|
|
|
|
|
|
void f1()
|
|
|
|
{
|
2009-02-18 03:53:58 +08:00
|
|
|
int i;
|
|
|
|
|
|
|
|
int j = i ? : 1; // expected-warning{{use of uninitialized variable}} //expected-warning{{Value stored to 'j' during its initialization is never read}}
|
2007-12-01 03:04:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void *f2(int *i)
|
|
|
|
{
|
2009-02-18 03:53:58 +08:00
|
|
|
return i ? : 0;
|
2007-12-01 03:04:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void *f3(int *i)
|
|
|
|
{
|
2009-02-18 03:53:58 +08:00
|
|
|
int a;
|
|
|
|
|
|
|
|
return &a ? : i;
|
2007-12-01 03:04:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void f4()
|
|
|
|
{
|
2009-02-18 03:53:58 +08:00
|
|
|
char c[1 ? : 2];
|
2007-12-01 03:04:31 +08:00
|
|
|
}
|
|
|
|
|