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