no-outofbounds.c revision 4fcfde4d5c8f25e40720972a5543d538a0dcb220
1// RUN: clang-cc -checker-cfref -analyze -analyzer-store=basic -verify %s
2// RUN: clang-cc -checker-cfref -analyze -analyzer-store=region -verify %s
3
4//===----------------------------------------------------------------------===//
5// This file tests cases where we should not flag out-of-bounds warnings.
6//===----------------------------------------------------------------------===//
7
8void f() {
9  long x = 0;
10  char *y = (char*) &x;
11  char c = y[0] + y[1] + y[2]; // no-warning
12}
13