aboutsummaryrefslogtreecommitdiffstats
path: root/test/Instrumentation
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-11-11 13:37:10 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-11-11 13:37:10 +0000
commit4590b8c090dade63d6cb1ba39109331607036f4d (patch)
tree63c1f196d60f61bbd259fb6f528262bd3b4118ca /test/Instrumentation
parent40f689851f6737d59b6f6a771ab1e07ce84c9bc3 (diff)
downloadexternal_llvm-4590b8c090dade63d6cb1ba39109331607036f4d.zip
external_llvm-4590b8c090dade63d6cb1ba39109331607036f4d.tar.gz
external_llvm-4590b8c090dade63d6cb1ba39109331607036f4d.tar.bz2
[msan] Propagate origin for insertvalue, extractvalue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194374 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Instrumentation')
-rw-r--r--test/Instrumentation/MemorySanitizer/msan_basic.ll26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Instrumentation/MemorySanitizer/msan_basic.ll b/test/Instrumentation/MemorySanitizer/msan_basic.ll
index ad9c5d7..72a992d 100644
--- a/test/Instrumentation/MemorySanitizer/msan_basic.ll
+++ b/test/Instrumentation/MemorySanitizer/msan_basic.ll
@@ -775,3 +775,29 @@ entry:
; CHECK-AA: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* {{.*}}, i64 2, i32 2, i1 false)
; CHECK-AA: ret i16
+
+; Test origin propagation for insertvalue
+
+define { i64, i32 } @make_pair_64_32(i64 %x, i32 %y) sanitize_memory {
+entry:
+ %a = insertvalue { i64, i32 } undef, i64 %x, 0
+ %b = insertvalue { i64, i32 } %a, i32 %y, 1
+ ret { i64, i32 } %b
+}
+
+; CHECK-ORIGINS: @make_pair_64_32
+; First element shadow
+; CHECK-ORIGINS: insertvalue { i64, i32 } { i64 -1, i32 -1 }, i64 {{.*}}, 0
+; First element origin
+; CHECK-ORIGINS: icmp ne i64
+; CHECK-ORIGINS: select i1
+; First element app value
+; CHECK-ORIGINS: insertvalue { i64, i32 } undef, i64 {{.*}}, 0
+; Second element shadow
+; CHECK-ORIGINS: insertvalue { i64, i32 } {{.*}}, i32 {{.*}}, 1
+; Second element origin
+; CHECK-ORIGINS: icmp ne i32
+; CHECK-ORIGINS: select i1
+; Second element app value
+; CHECK-ORIGINS: insertvalue { i64, i32 } {{.*}}, i32 {{.*}}, 1
+; CHECK-ORIGINS: ret { i64, i32 }