summaryrefslogtreecommitdiffstats
path: root/llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-08-12 00:12:43 +0000
committerReid Kleckner <reid@kleckner.net>2014-08-12 00:12:43 +0000
commit3ae6e1528a29a0c717d2f2c6a63e9dcb67731cd7 (patch)
tree641dea30c8c0278721461fb2288e247035028540 /llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
parent981a64c380bea01b35d3426e194c8f8f5f7ec709 (diff)
downloadbcm5719-llvm-3ae6e1528a29a0c717d2f2c6a63e9dcb67731cd7.tar.gz
bcm5719-llvm-3ae6e1528a29a0c717d2f2c6a63e9dcb67731cd7.zip
msan: Handle musttail calls
First, avoid calling setTailCall(false) on musttail calls. The funciton prototypes should be "congruent", so the shadow layout should be exactly the same. Second, avoid inserting instrumentation after a musttail call to propagate the return value shadow. We don't need to propagate the result of a tail call, it should already be in the right place. Reviewed By: eugenis Differential Revision: http://reviews.llvm.org/D4331 llvm-svn: 215415
Diffstat (limited to 'llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll')
-rw-r--r--llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll b/llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
index 0faf45d70c5..27c23145e61 100644
--- a/llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
+++ b/llvm/test/Instrumentation/MemorySanitizer/msan_basic.ll
@@ -878,3 +878,16 @@ define void @MismatchedReturnTypeTailCall(i32 %a) sanitize_memory {
; CHECK-LABEL: define void @MismatchedReturnTypeTailCall
; CHECK: tail call i32 @InnerTailCall
; CHECK: ret void
+
+declare i32 @InnerMustTailCall(i32 %a)
+
+define i32 @MustTailCall(i32 %a) {
+ %b = musttail call i32 @InnerMustTailCall(i32 %a)
+ ret i32 %b
+}
+
+; Test that 'musttail' is preserved. The ABI should make this work.
+
+; CHECK-LABEL: define i32 @MustTailCall
+; CHECK: musttail call i32 @InnerMustTailCall
+; CHECK-NEXT: ret i32
OpenPOWER on IntegriCloud