no-outofbounds.c revision 565e465c6d0093f1bf8414b2cabdc842022385a9
1// RUN: %clang_cc1 -analyzer-check-objc-mem -analyze -analyzer-experimental-internal-checks -analyzer-store=basic -verify %s
2// RUN: %clang_cc1 -analyzer-check-objc-mem -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