blob: d1a07abf527f99dfbc3bb42765c17e9e8ed2c7fe [file] [log] [blame]
Ted Kremenek8382cf52009-11-13 18:46:29 +00001// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s
Zhongxing Xu20f01782008-11-24 02:19:49 +00002
3char f1() {
4 char* s = "abcd";
Ted Kremenekf9e96842009-01-22 20:36:33 +00005 char c = s[4]; // no-warning
Zhongxing Xu58e689f2009-11-11 12:33:27 +00006 return s[5] + c; // expected-warning{{Access out-of-bound array element (buffer overflow)}}
Zhongxing Xu20f01782008-11-24 02:19:49 +00007}