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