mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
[GC] Verify-pass void vararg functions in gc.statepoint
With the appropriate Verifier changes, exactracting the result out of a statepoint wrapping a vararg function crashes. However, a void vararg function works fine: commit this first step. Differential Revision: http://reviews.llvm.org/D7071 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226599 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -9,6 +9,7 @@ declare zeroext i1 @return_i1()
|
||||
declare zeroext i32 @return_i32()
|
||||
declare i32* @return_i32ptr()
|
||||
declare float @return_float()
|
||||
declare void @varargf(i32, ...)
|
||||
|
||||
define i1 @test_i1_return() gc "statepoint-example" {
|
||||
; CHECK-LABEL: test_i1_return
|
||||
@@ -75,6 +76,17 @@ entry:
|
||||
ret i1 %call2
|
||||
}
|
||||
|
||||
define void @test_void_vararg() gc "statepoint-example" {
|
||||
; CHECK-LABEL: test_void_vararg
|
||||
; Check a statepoint wrapping a *void* returning vararg function works
|
||||
; CHECK: callq varargf
|
||||
entry:
|
||||
%safepoint_token = tail call i32 (void (i32, ...)*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidi32varargf(void (i32, ...)* @varargf, i32 2, i32 0, i32 42, i32 43, i32 0)
|
||||
;; if we try to use the result from a statepoint wrapping a
|
||||
;; non-void-returning varargf, we will experience a crash.
|
||||
ret void
|
||||
}
|
||||
|
||||
declare i32 @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()*, i32, i32, ...)
|
||||
declare i1 @llvm.experimental.gc.result.int.i1(i32)
|
||||
|
||||
@@ -87,4 +99,6 @@ declare i32* @llvm.experimental.gc.result.ptr.p0i32(i32)
|
||||
declare i32 @llvm.experimental.gc.statepoint.p0f_f32f(float ()*, i32, i32, ...)
|
||||
declare float @llvm.experimental.gc.result.float.f32(i32)
|
||||
|
||||
declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidi32varargf(void (i32, ...)*, i32, i32, ...)
|
||||
|
||||
declare i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32, i32, i32)
|
||||
|
||||
Reference in New Issue
Block a user