summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-07-03 11:35:08 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-07-03 11:35:08 +0000
commitc3c39843d38a41b90a12c3e1787007528bd178b3 (patch)
treeb065d3229e0fbd746dfdf7769b3119d25179aca2
parentd64ad1da29909b038ddb2cecbceac300f6fa9028 (diff)
downloadcompiler-rt-c3c39843d38a41b90a12c3e1787007528bd178b3.tar.gz
Revert of r212265.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@212266 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/msan/no_sanitize_memory_prop.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/msan/no_sanitize_memory_prop.cc b/test/msan/no_sanitize_memory_prop.cc
index 4275ebbf7..b41e8a151 100644
--- a/test/msan/no_sanitize_memory_prop.cc
+++ b/test/msan/no_sanitize_memory_prop.cc
@@ -1,9 +1,16 @@
// RUN: %clangxx_msan -m64 -O0 %s -o %t && %run %t >%t.out 2>&1
-// RUN: %clangxx_msan -m64 -O1 %s -o %t && %run %t >%t.out 2>&1
-// RUN: %clangxx_msan -m64 -O2 %s -o %t && %run %t >%t.out 2>&1
-// RUN: %clangxx_msan -m64 -O3 %s -o %t && %run %t >%t.out 2>&1
+// RUN: %clangxx_msan -m64 -O1 %s -o %t && not %run %t >%t.out 2>&1
+// RUN: FileCheck %s < %t.out
+// RUN: %clangxx_msan -m64 -O2 %s -o %t && not %run %t >%t.out 2>&1
+// RUN: FileCheck %s < %t.out
+// RUN: %clangxx_msan -m64 -O3 %s -o %t && not %run %t >%t.out 2>&1
+// RUN: FileCheck %s < %t.out
-// Test that (no_sanitize_memory) functions DO NOT propagate shadow.
+// Test that (no_sanitize_memory) functions propagate shadow.
+
+// Note that at -O0 there is no report, because 'x' in 'f' is spilled to the
+// stack, and then loaded back as a fully initialiazed value (due to
+// no_sanitize_memory attribute).
#include <stdlib.h>
#include <stdio.h>
@@ -18,6 +25,8 @@ int main(void) {
int x;
int * volatile p = &x;
int y = f(*p);
+ // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
+ // CHECK: {{#0 0x.* in main .*no_sanitize_memory_prop.cc:}}[[@LINE+1]]
if (y)
exit(0);
return 0;