1 // RUN: %clangxx_asan -O0 -std=c++11 %s -o %t && %run %t 2>&1 | FileCheck %s
2 // RUN: %clangxx_asan -O1 -std=c++11 %s -o %t && %run %t 2>&1 | FileCheck %s
3 // RUN: %clangxx_asan -O2 -std=c++11 %s -o %t && %run %t 2>&1 | FileCheck %s
5 // Test that we do not detect false buffer overflows cased by optimization when
6 // when local variable replaced by a smaller global constant.
7 // https://bugs.llvm.org/show_bug.cgi?id=33372
12 struct A
{ int x
, y
, z
; };
13 struct B
{ A a
; /*gap*/ long b
; };
22 const char KKK
[] = {1, 1, 2};
27 memcpy(cc
, KKK
, sizeof(KKK
));
28 memcpy(bbb
, cc
, sizeof(bbb
));
31 int main(int argc
, char *argv
[]) {
38 // CHECK-NOT: ERROR: AddressSanitizer