diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-06-25 14:41:57 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-06-25 14:41:57 +0000 |
commit | 6ce4a9f175830e7e981b885e4dc80bc53bda3d77 (patch) | |
tree | 5c91c8c978a757f9941e3611fa195613849c94b5 /test/Instrumentation | |
parent | 95be6a7c3d841e2d30a96579d4fe8457748477fa (diff) | |
download | llvm-6ce4a9f175830e7e981b885e4dc80bc53bda3d77.tar.gz llvm-6ce4a9f175830e7e981b885e4dc80bc53bda3d77.tar.bz2 llvm-6ce4a9f175830e7e981b885e4dc80bc53bda3d77.tar.xz |
[msan] Fix bad interaction between with-calls mode and chained origin tracking.
Origin history should only be recorded for uninitialized values, because it is
meaningless otherwise. This change moves __msan_chain_origin to the runtime
library side and makes it conditional on the corresponding shadow value.
Previous code was correct, but _very_ inefficient.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Instrumentation')
-rw-r--r-- | test/Instrumentation/MemorySanitizer/instrumentation-with-call-threshold.ll | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Instrumentation/MemorySanitizer/instrumentation-with-call-threshold.ll b/test/Instrumentation/MemorySanitizer/instrumentation-with-call-threshold.ll index 34988ef605..beb3c5fad7 100644 --- a/test/Instrumentation/MemorySanitizer/instrumentation-with-call-threshold.ll +++ b/test/Instrumentation/MemorySanitizer/instrumentation-with-call-threshold.ll @@ -1,7 +1,10 @@ ; Test -msan-instrumentation-with-call-threshold +; Test that in with-calls mode there are no calls to __msan_chain_origin - they +; are done from __msan_maybe_store_origin_*. ; RUN: opt < %s -msan -msan-check-access-address=0 -msan-instrumentation-with-call-threshold=0 -S | FileCheck %s ; RUN: opt < %s -msan -msan-check-access-address=0 -msan-instrumentation-with-call-threshold=0 -msan-track-origins=1 -S | FileCheck -check-prefix=CHECK -check-prefix=CHECK-ORIGINS %s +; RUN: opt < %s -msan -msan-check-access-address=0 -msan-instrumentation-with-call-threshold=0 -msan-track-origins=2 -S | FileCheck -check-prefix=CHECK -check-prefix=CHECK-ORIGINS %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" @@ -41,7 +44,10 @@ entry: ; CHECK: load {{.*}} @__msan_param_tls ; CHECK-ORIGINS: load {{.*}} @__msan_param_origin_tls ; CHECK: store +; CHECK-ORIGINS-NOT: __msan_chain_origin ; CHECK-ORIGINS: bitcast i64* {{.*}} to i8* +; CHECK-ORIGINS-NOT: __msan_chain_origin ; CHECK-ORIGINS: call void @__msan_maybe_store_origin_8( +; CHECK-ORIGINS-NOT: __msan_chain_origin ; CHECK: store i64 ; CHECK: ret void |