summaryrefslogtreecommitdiff
path: root/test/Instrumentation
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2012-12-14 13:43:11 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2012-12-14 13:43:11 +0000
commit63cca4e2fd4dd70e54055c4d34d858f810e0bd44 (patch)
treeccfee29a6940e6d03863d81f12e8b68acbd4cce5 /test/Instrumentation
parente6b63c11886a3a61bba2056b269276884abc1e46 (diff)
downloadllvm-63cca4e2fd4dd70e54055c4d34d858f810e0bd44.tar.gz
llvm-63cca4e2fd4dd70e54055c4d34d858f810e0bd44.tar.bz2
llvm-63cca4e2fd4dd70e54055c4d34d858f810e0bd44.tar.xz
[msan] Origin stores and loads do not need explicit alignment.
Origin address is always 4 byte aligned, and the access type is always i32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170199 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Instrumentation')
-rw-r--r--test/Instrumentation/MemorySanitizer/msan_basic.ll30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Instrumentation/MemorySanitizer/msan_basic.ll b/test/Instrumentation/MemorySanitizer/msan_basic.ll
index 3228863193..b6dcd16662 100644
--- a/test/Instrumentation/MemorySanitizer/msan_basic.ll
+++ b/test/Instrumentation/MemorySanitizer/msan_basic.ll
@@ -8,7 +8,9 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
; Check the presence and the linkage type of __msan_track_origins
; CHECK: @__msan_track_origins = weak_odr constant i32 0
+
; Check instrumentation of stores
+
define void @Store(i32* nocapture %p, i32 %x) nounwind uwtable {
entry:
store i32 %x, i32* %p, align 4
@@ -33,6 +35,34 @@ entry:
; CHECK-ORIGINS: ret void
+; Check instrumentation of aligned stores
+; Shadow store has the same alignment as the original store; origin store
+; does not specify explicit alignment.
+
+define void @AlignedStore(i32* nocapture %p, i32 %x) nounwind uwtable {
+entry:
+ store i32 %x, i32* %p, align 32
+ ret void
+}
+
+; CHECK: @AlignedStore
+; CHECK: load {{.*}} @__msan_param_tls
+; CHECK: store {{.*}} align 32
+; CHECK: store {{.*}} align 32
+; CHECK: ret void
+; CHECK-ORIGINS: @AlignedStore
+; CHECK-ORIGINS: load {{.*}} @__msan_param_tls
+; CHECK-ORIGINS: store {{.*}} align 32
+; CHECK-ORIGINS: icmp
+; CHECK-ORIGINS: br i1
+; CHECK-ORIGINS: <label>
+; CHECK-ORIGINS-NOT: store {{.*}} align
+; CHECK-ORIGINS: br label
+; CHECK-ORIGINS: <label>
+; CHECK-ORIGINS: store {{.*}} align 32
+; CHECK-ORIGINS: ret void
+
+
; load followed by cmp: check that we load the shadow and call __msan_warning.
define void @LoadAndCmp(i32* nocapture %a) nounwind uwtable {
entry: