Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / msan / origin-store-long.cpp
blobece050333830f02369716474e60647471c4e59a4
1 // Check that 8-byte store updates origin for the full store range.
2 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1
3 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out
4 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O2 %s -o %t && not %run %t >%t.out 2>&1
5 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out
7 #include <sanitizer/msan_interface.h>
9 int main() {
10 uint64_t *volatile p = new uint64_t;
11 uint64_t *volatile q = new uint64_t;
12 *p = *q;
13 char *z = (char *)p;
14 return z[6];
15 // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
16 // CHECK: in main {{.*}}origin-store-long.cpp:[[@LINE-2]]
18 // CHECK: Uninitialized value was created by a heap allocation
19 // CHECK: in main {{.*}}origin-store-long.cpp:[[@LINE-8]]