Files
clang-p2996/llvm/test/CodeGen/X86/GC/inline2.ll
Nikita Popov 2f448bf509 [X86] Migrate tests to use opaque pointers (NFC)
Test updates were performed using:
https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34

These are only the test updates where the test passed without
further modification (which is almost all of them, as the backend
is largely pointer-type agnostic).
2022-06-22 14:38:25 +02:00

24 lines
624 B
LLVM

; RUN: opt < %s -inline -S | grep sample
; RUN: opt < %s -inline -S | grep example
%IntArray = type { i32, [0 x ptr] }
declare void @llvm.gcroot(ptr, ptr) nounwind
define i32 @f() gc "sample" {
%x = call i32 @g( ) ; <i32> [#uses=1]
ret i32 %x
}
define internal i32 @g() gc "example" {
%root = alloca ptr ; <ptr> [#uses=2]
call void @llvm.gcroot( ptr %root, ptr null )
%obj = call ptr @h( ) ; <ptr> [#uses=2]
store ptr %obj, ptr %root
%Length.ptr = getelementptr %IntArray, ptr %obj, i32 0, i32 0 ; <ptr> [#uses=1]
%Length = load i32, ptr %Length.ptr ; <i32> [#uses=1]
ret i32 %Length
}
declare ptr @h()