1 // RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1
2 // RUN: FileCheck %s < %t.out
3 // RUN: %clangxx_msan -O1 %s -o %t && not %run %t >%t.out 2>&1
4 // RUN: FileCheck %s < %t.out
5 // RUN: %clangxx_msan -O2 %s -o %t && not %run %t >%t.out 2>&1
6 // RUN: FileCheck %s < %t.out
7 // RUN: %clangxx_msan -O3 %s -o %t && not %run %t >%t.out 2>&1
8 // RUN: FileCheck %s < %t.out
10 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1
11 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out
12 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O1 %s -o %t && not %run %t >%t.out 2>&1
13 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out
14 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O2 %s -o %t && not %run %t >%t.out 2>&1
15 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out
16 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t && not %run %t >%t.out 2>&1
17 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-ORIGINS < %t.out
20 int main(int argc
, char **argv
) {
24 // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
25 // CHECK: {{#0 0x.* in main .*stack-origin.cpp:}}[[@LINE-2]]
27 // CHECK-ORIGINS: Uninitialized value was created by an allocation of 'x' in the stack frame of function 'main'
28 // CHECK-ORIGINS: {{#0 0x.* in main .*stack-origin.cpp:}}[[@LINE-8]]
30 // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*stack-origin.cpp:.* main}}