llvm-capstone/compiler-rt/test/msan/origin-store-long.cc
Alexey Samsonov d06aa3dc00 [MSan] Remove explicit -m64 from RUN lines.
Target-specific flags should usually be configured by CMake/lit.

llvm-svn: 230999
2015-03-02 19:34:27 +00:00

22 lines
797 B
C++

// Check that 8-byte store updates origin for the full store range.
// RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1
// RUN: FileCheck %s < %t.out && FileCheck %s < %t.out
// RUN: %clangxx_msan -fsanitize-memory-track-origins -O2 %s -o %t && not %run %t >%t.out 2>&1
// RUN: FileCheck %s < %t.out && FileCheck %s < %t.out
#include <sanitizer/msan_interface.h>
int main() {
uint64_t *volatile p = new uint64_t;
uint64_t *volatile q = new uint64_t;
*p = *q;
char *z = (char *)p;
return z[6];
// CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
// CHECK: in main {{.*}}origin-store-long.cc:[[@LINE-2]]
// CHECK: Uninitialized value was created by a heap allocation
// CHECK: in main {{.*}}origin-store-long.cc:[[@LINE-8]]
}