1*7c3d14c8STreehugger Robot // RUN: %clangxx_msan -O0 %s -o %t && not %run %t >%t.out 2>&1 2*7c3d14c8STreehugger Robot // RUN: FileCheck %s < %t.out 3*7c3d14c8STreehugger Robot // RUN: %clangxx_msan -O1 %s -o %t && not %run %t >%t.out 2>&1 4*7c3d14c8STreehugger Robot // RUN: FileCheck %s < %t.out 5*7c3d14c8STreehugger Robot // RUN: %clangxx_msan -O2 %s -o %t && not %run %t >%t.out 2>&1 6*7c3d14c8STreehugger Robot // RUN: FileCheck %s < %t.out 7*7c3d14c8STreehugger Robot // RUN: %clangxx_msan -O3 %s -o %t && not %run %t >%t.out 2>&1 8*7c3d14c8STreehugger Robot // RUN: FileCheck %s < %t.out 9*7c3d14c8STreehugger Robot 10*7c3d14c8STreehugger Robot #include <stdlib.h> main(int argc,char ** argv)11*7c3d14c8STreehugger Robotint main(int argc, char **argv) { 12*7c3d14c8STreehugger Robot int x; 13*7c3d14c8STreehugger Robot int *volatile p = &x; 14*7c3d14c8STreehugger Robot int z = *p ? 1 : 0; 15*7c3d14c8STreehugger Robot if (z) 16*7c3d14c8STreehugger Robot exit(0); 17*7c3d14c8STreehugger Robot // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value 18*7c3d14c8STreehugger Robot // CHECK: {{#0 0x.* in main .*select.cc:}}[[@LINE-3]] 19*7c3d14c8STreehugger Robot 20*7c3d14c8STreehugger Robot // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*select.cc:.* main}} 21*7c3d14c8STreehugger Robot return 0; 22*7c3d14c8STreehugger Robot } 23