Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / msan / chained_origin_empty_stack.cpp
blob101016f2d347caddfcd1b5c310d4c02bb5b4d3b4
1 // RUN: %clangxx_msan -fno-sanitize-memory-param-retval -fsanitize-memory-track-origins=2 -O3 %s -o %t && \
2 // RUN: MSAN_OPTIONS=store_context_size=1 not %run %t 2>&1 | FileCheck %s
4 // Test that stack trace for the intermediate store is not empty.
6 // CHECK: MemorySanitizer: use-of-uninitialized-value
7 // CHECK: #0 {{.*}} in main
9 // CHECK: Uninitialized value was stored to memory at
10 // CHECK: #0 {{.*}} in fn_g
11 // CHECK-NOT: #1
13 // CHECK: Uninitialized value was created by an allocation of 'z' in the stack frame
14 // CHECK: #0 {{.*}} in main
16 #include <stdio.h>
18 volatile int x;
20 __attribute__((noinline))
21 void fn_g(int a) {
22 x = a;
25 __attribute__((noinline))
26 void fn_f(int a) {
27 fn_g(a);
30 int main(int argc, char *argv[]) {
31 int volatile z;
32 fn_f(z);
33 return x;