1 ; RUN: llc -verify-machineinstrs -O3 < %s | FileCheck %s
3 ; This is checking for a crash.
5 target triple = "x86_64-pc-linux-gnu"
7 define <2 x ptr addrspace(1)> @test0(ptr addrspace(1) %el, ptr %vec_ptr) gc "statepoint-example" {
11 %tok0 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) ["gc-live" (ptr addrspace(1) %el)]
12 %el.relocated = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %tok0, i32 0, i32 0)
14 %obj.pre = load <2 x ptr addrspace(1)>, ptr %vec_ptr
15 %obj = insertelement <2 x ptr addrspace(1)> %obj.pre, ptr addrspace(1) %el.relocated, i32 0 ; No real objective here, except to use %el
17 %tok1 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) ["gc-live" (<2 x ptr addrspace(1)> %obj)]
18 %obj.relocated = call <2 x ptr addrspace(1)> @llvm.experimental.gc.relocate.v2p1(token %tok1, i32 0, i32 0)
19 ret <2 x ptr addrspace(1)> %obj.relocated
22 define ptr addrspace(1) @test1(<2 x ptr addrspace(1)> %obj) gc "statepoint-example" {
26 %tok1 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) ["gc-live" (<2 x ptr addrspace(1)> %obj)]
27 %obj.relocated = call <2 x ptr addrspace(1)> @llvm.experimental.gc.relocate.v2p1(token %tok1, i32 0, i32 0)
29 %el = extractelement <2 x ptr addrspace(1)> %obj.relocated, i32 0
30 %tok0 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) ["gc-live" (ptr addrspace(1) %el)]
31 %el.relocated = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %tok0, i32 0, i32 0)
32 ret ptr addrspace(1) %el.relocated
35 declare void @do_safepoint()
37 declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
38 declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32)
39 declare <2 x ptr addrspace(1)> @llvm.experimental.gc.relocate.v2p1(token, i32, i32)