no-outofbounds.c revision 8382cf57b722f130f1a6b45380639871c07271c1
1// RUN: clang-cc -checker-cfref -analyze -analyzer-experimental-internal-checks -analyzer-store=basic -verify %s
2// RUN: clang-cc -checker-cfref -analyze -analyzer-experimental-internal-checks -analyzer-store=region -verify %s
3// XFAIL: *
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