diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-09-03 10:08:14 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-09-03 10:08:14 +0000 |
commit | 499d480be5870b82504f4fb809d4f67624bbadd6 (patch) | |
tree | 53486674dc4c84ade5e77945b7d8e65168240437 /compiler-rt | |
parent | f9ddb439754e2cfb771140dcb047842a3dc75eb1 (diff) | |
download | bcm5719-llvm-499d480be5870b82504f4fb809d4f67624bbadd6.tar.gz bcm5719-llvm-499d480be5870b82504f4fb809d4f67624bbadd6.zip |
[msan] Another regression test for r189786.
llvm-svn: 189787
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/lib/msan/lit_tests/select.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler-rt/lib/msan/lit_tests/select.cc b/compiler-rt/lib/msan/lit_tests/select.cc new file mode 100644 index 00000000000..a169a2dd911 --- /dev/null +++ b/compiler-rt/lib/msan/lit_tests/select.cc @@ -0,0 +1,22 @@ +// RUN: %clangxx_msan -m64 -O0 %s -o %t && not %t >%t.out 2>&1 +// RUN: FileCheck %s < %t.out +// RUN: %clangxx_msan -m64 -O1 %s -o %t && not %t >%t.out 2>&1 +// RUN: FileCheck %s < %t.out +// RUN: %clangxx_msan -m64 -O2 %s -o %t && not %t >%t.out 2>&1 +// RUN: FileCheck %s < %t.out +// RUN: %clangxx_msan -m64 -O3 %s -o %t && not %t >%t.out 2>&1 +// RUN: FileCheck %s < %t.out + +#include <stdlib.h> +int main(int argc, char **argv) { + int x; + int *volatile p = &x; + int z = *p ? 1 : 0; + if (z) + exit(0); + // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value + // CHECK: {{#0 0x.* in main .*select.cc:}}[[@LINE-3]] + + // CHECK: SUMMARY: MemorySanitizer: use-of-uninitialized-value {{.*select.cc:.* main}} + return 0; +} |