summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2017-07-11 18:13:52 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2017-07-11 18:13:52 +0000
commit3d5ea713f7d5a824e091adcf81a3d9fc38010d03 (patch)
tree74b59d896cf6d22d239be097c211e80a04e73b5e /llvm/test
parentb9fb12291ac309d96af79801ce449026104949a7 (diff)
downloadbcm5719-llvm-3d5ea713f7d5a824e091adcf81a3d9fc38010d03.tar.gz
bcm5719-llvm-3d5ea713f7d5a824e091adcf81a3d9fc38010d03.zip
[msan] Only check shadow memory for operands that are sized.
Fixes PR33347: https://bugs.llvm.org/show_bug.cgi?id=33347. Differential Revision: https://reviews.llvm.org/D35160 Patch by Matt Morehouse. llvm-svn: 307684
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Instrumentation/MemorySanitizer/unsized_type.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Instrumentation/MemorySanitizer/unsized_type.ll b/llvm/test/Instrumentation/MemorySanitizer/unsized_type.ll
new file mode 100644
index 00000000000..94ae92d3354
--- /dev/null
+++ b/llvm/test/Instrumentation/MemorySanitizer/unsized_type.ll
@@ -0,0 +1,22 @@
+; Check that unsized token types used by coroutine intrinsics do not cause
+; assertion failures.
+; RUN: opt < %s -msan -S 2>&1 | FileCheck %s
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+declare token @llvm.coro.id(i32, i8* readnone, i8* nocapture readonly, i8*)
+declare i1 @llvm.coro.alloc(token)
+
+define void @foo() sanitize_memory {
+entry:
+ %id = call token @llvm.coro.id(i32 0, i8* null, i8* null, i8* null)
+ %dyn.alloc.reqd = call i1 @llvm.coro.alloc(token %id)
+ ret void
+}
+
+; CHECK: define void @foo
+; CHECK-NEXT: entry:
+; CHECK-NEXT: %id = call token @llvm.coro.id
+; CHECK-NEXT: call i1 @llvm.coro.alloc(token %id)
+; CHECK-NEXT: ret void
OpenPOWER on IntegriCloud