1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core -verify -fblocks %s
3 // <rdar://problem/6776949>
4 // main's 'argc' argument is always > 0
5 int main(int argc, char* argv[]) {
21 return *p; // no-warning
24 // PR 5969: the comparison of argc < 3 || argc > 4 should constraint the switch
25 // statement from having the 'default' branch taken. This previously reported a false
26 // positive with the use of 'v'.
28 int pr5969(int argc, char *argv[]) {
32 if ((argc < 3) || (argc > 4)) return 0;
43 return v; // no-warning
46 int pr5969_positive(int argc, char *argv[]) {
50 if ((argc < 3) || (argc > 4)) return 0;
58 return v; // expected-warning{{Undefined or garbage value returned to caller}}