summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2018-11-16 14:28:05 +0000
committerThan McIntosh <thanm@google.com>2018-11-16 14:28:05 +0000
commit4a1c5da7ac063a6a73da973871fb9584fce19104 (patch)
tree6ed5096a117a730cbb6a6abcdc449e72052ef599 /llvm/test
parent705fbd5d4ff5abd39c5fb50c4a55988d78e94b68 (diff)
downloadbcm5719-llvm-4a1c5da7ac063a6a73da973871fb9584fce19104.tar.gz
bcm5719-llvm-4a1c5da7ac063a6a73da973871fb9584fce19104.zip
[IRVerifier] Allow StructRet in statepoint
Summary: StructRet attribute is not allowed in vararg calls. The statepoint intrinsic is vararg, but the wrapped function may be not. Allow calls of statepoint with StructRet arg, as long as the wrapped function is not vararg. Reviewers: thanm, anna Reviewed By: anna Subscribers: anna, llvm-commits Differential Revision: https://reviews.llvm.org/D53602 llvm-svn: 347050
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Verifier/statepoint.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Verifier/statepoint.ll b/llvm/test/Verifier/statepoint.ll
index c07a85b9bd3..8dba5c4d02a 100644
--- a/llvm/test/Verifier/statepoint.ll
+++ b/llvm/test/Verifier/statepoint.ll
@@ -4,6 +4,7 @@ declare void @use(...)
declare i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token, i32, i32)
declare i64 addrspace(1)* @llvm.experimental.gc.relocate.p1i64(token, i32, i32)
declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
+declare token @llvm.experimental.gc.statepoint.p0f_isVoidp0s_structsf(i64, i32, void (%struct*)*, i32, i32, ...)
declare i32 @"personality_function"()
;; Basic usage
@@ -79,3 +80,20 @@ exceptional_return:
%obj1.relocated1 = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %landing_pad, i32 12, i32 12)
ret i8 addrspace(1)* %obj1.relocated1
}
+
+; Test for statepoint with sret attribute.
+; This should be allowed as long as the wrapped function is not vararg.
+%struct = type { i64, i64, i64 }
+
+declare void @fn_sret(%struct* sret)
+
+define void @test_sret() gc "statepoint-example" {
+ %x = alloca %struct
+ %statepoint_token = call token (i64, i32, void (%struct*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidp0s_structsf(i64 0, i32 0, void (%struct*)* @fn_sret, i32 1, i32 0, %struct* sret %x, i32 0, i32 0)
+ ret void
+ ; CHECK-LABEL: test_sret
+ ; CHECK: alloca
+ ; CHECK: statepoint
+ ; CHECK-SAME: sret
+ ; CHECK: ret
+}
OpenPOWER on IntegriCloud