diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-01-25 15:31:10 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2013-01-25 15:31:10 +0000 |
commit | 351f65d9723c075af86466c07a0a3dc28be272cd (patch) | |
tree | 82e09d16ae205017d64d6640d0e2ca398d0dcfd1 /test/Instrumentation | |
parent | ea387fc3b8cf12c3c6ad218b81eca156e8173bba (diff) | |
download | external_llvm-351f65d9723c075af86466c07a0a3dc28be272cd.zip external_llvm-351f65d9723c075af86466c07a0a3dc28be272cd.tar.gz external_llvm-351f65d9723c075af86466c07a0a3dc28be272cd.tar.bz2 |
[msan] Implement exact shadow propagation for relational ICmp.
Only for integers, pointers, and vectors of those. No floats.
Instrumentation seems very heavy, and may need to be replaced
with some approximation in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Instrumentation')
-rw-r--r-- | test/Instrumentation/MemorySanitizer/msan_basic.ll | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/test/Instrumentation/MemorySanitizer/msan_basic.ll b/test/Instrumentation/MemorySanitizer/msan_basic.ll index a3caa80..16453c5 100644 --- a/test/Instrumentation/MemorySanitizer/msan_basic.ll +++ b/test/Instrumentation/MemorySanitizer/msan_basic.ll @@ -323,6 +323,8 @@ define zeroext i1 @ICmpSLT(i32 %x) nounwind uwtable readnone { ; CHECK-NOT: call void @__msan_warning ; CHECK: icmp slt ; CHECK-NOT: call void @__msan_warning +; CHECK: icmp slt +; CHECK-NOT: call void @__msan_warning ; CHECK: ret i1 define zeroext i1 @ICmpSGE(i32 %x) nounwind uwtable readnone { @@ -331,7 +333,9 @@ define zeroext i1 @ICmpSGE(i32 %x) nounwind uwtable readnone { } ; CHECK: @ICmpSGE -; CHECK: icmp slt +; CHECK: icmp sge +; CHECK-NOT: call void @__msan_warning +; CHECK: icmp sge ; CHECK-NOT: call void @__msan_warning ; CHECK: icmp sge ; CHECK-NOT: call void @__msan_warning @@ -343,7 +347,9 @@ define zeroext i1 @ICmpSGT(i32 %x) nounwind uwtable readnone { } ; CHECK: @ICmpSGT -; CHECK: icmp slt +; CHECK: icmp sgt +; CHECK-NOT: call void @__msan_warning +; CHECK: icmp sgt ; CHECK-NOT: call void @__msan_warning ; CHECK: icmp sgt ; CHECK-NOT: call void @__msan_warning @@ -355,7 +361,9 @@ define zeroext i1 @ICmpSLE(i32 %x) nounwind uwtable readnone { } ; CHECK: @ICmpSLE -; CHECK: icmp slt +; CHECK: icmp sle +; CHECK-NOT: call void @__msan_warning +; CHECK: icmp sle ; CHECK-NOT: call void @__msan_warning ; CHECK: icmp sle ; CHECK-NOT: call void @__msan_warning @@ -373,11 +381,31 @@ define <2 x i1> @ICmpSLT_vector(<2 x i32*> %x) nounwind uwtable readnone { ; CHECK: @ICmpSLT_vector ; CHECK: icmp slt <2 x i64> ; CHECK-NOT: call void @__msan_warning +; CHECK: icmp slt <2 x i64> +; CHECK-NOT: call void @__msan_warning ; CHECK: icmp slt <2 x i32*> ; CHECK-NOT: call void @__msan_warning ; CHECK: ret <2 x i1> +; Check that we propagate shadow for arbitrary relational comparisons + +define zeroext i1 @ICmpSLENonZero(i32 %x, i32 %y) nounwind uwtable readnone { +entry: + %cmp = icmp sle i32 %x, %y + ret i1 %cmp +} + +; CHECK: @ICmpSLENonZero +; CHECK: icmp sle i32 +; CHECK-NOT: call void @__msan_warning +; CHECK: icmp sle i32 +; CHECK-NOT: call void @__msan_warning +; CHECK: icmp sle i32 +; CHECK-NOT: call void @__msan_warning +; CHECK: ret i1 + + ; Check that loads of shadow have the same aligment as the original loads. ; Check that loads of origin have the aligment of max(4, original alignment). |