summaryrefslogtreecommitdiffstats
path: root/llvm/test/Instrumentation/MemorySanitizer/check-constant-shadow.ll
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-10-24 23:34:15 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-10-24 23:34:15 +0000
commitd337a59db56d9f1f53d67257c6dcba7842d8738a (patch)
tree25776e08511440b075cdb0b804439c7afd757252 /llvm/test/Instrumentation/MemorySanitizer/check-constant-shadow.ll
parent5a52e6dc9eeb07e44a62bdc828bc9b8b7348549d (diff)
downloadbcm5719-llvm-d337a59db56d9f1f53d67257c6dcba7842d8738a.tar.gz
bcm5719-llvm-d337a59db56d9f1f53d67257c6dcba7842d8738a.zip
[msan] Make -msan-check-constant-shadow a bit stronger.
Allow (under the experimental flag) non-Instructions to participate in MSan checks. llvm-svn: 220601
Diffstat (limited to 'llvm/test/Instrumentation/MemorySanitizer/check-constant-shadow.ll')
-rw-r--r--llvm/test/Instrumentation/MemorySanitizer/check-constant-shadow.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Instrumentation/MemorySanitizer/check-constant-shadow.ll b/llvm/test/Instrumentation/MemorySanitizer/check-constant-shadow.ll
new file mode 100644
index 00000000000..11e44106d8f
--- /dev/null
+++ b/llvm/test/Instrumentation/MemorySanitizer/check-constant-shadow.ll
@@ -0,0 +1,15 @@
+; RUN: opt < %s -msan -msan-check-constant-shadow=1 -S | FileCheck %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"
+
+; Test that returning a literal undef from main() triggers an MSan warning.
+
+define i32 @main() nounwind uwtable sanitize_memory {
+entry:
+ ret i32 undef
+}
+
+; CHECK-LABEL: @main
+; CHECK: call void @__msan_warning_noreturn
+; CHECK: ret i32 undef
OpenPOWER on IntegriCloud