1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc -verify-machineinstrs < %s | FileCheck %s 3 4target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128" 5target triple = "x86_64-pc-linux-gnu" 6 7declare void @use(...) 8declare void @f() 9declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...) 10declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32) 11 12;; Check that llvm doesn't crash if relocate with undef base/derived ptr survives until isel 13define void @test_gcrelocate_undef(ptr addrspace(1) %ptr) gc "statepoint-example" { 14; CHECK-LABEL: test_gcrelocate_undef: 15; CHECK: # %bb.0: 16; CHECK-NEXT: pushq %rax 17; CHECK-NEXT: .cfi_def_cfa_offset 16 18; CHECK-NEXT: movq %rdi, (%rsp) 19; CHECK-NEXT: callq f@PLT 20; CHECK-NEXT: .Ltmp0: 21; CHECK-NEXT: movl $4278124286, %edi # imm = 0xFEFEFEFE 22; CHECK-NEXT: xorl %eax, %eax 23; CHECK-NEXT: callq use@PLT 24; CHECK-NEXT: popq %rax 25; CHECK-NEXT: .cfi_def_cfa_offset 8 26; CHECK-NEXT: retq 27 %tok = tail call token (i64, i32, ptr, i32, i32, ...) 28 @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @f, i32 0, i32 0, i32 0, i32 0) ["gc-live" (ptr addrspace(1) %ptr, ptr addrspace(1) undef), "deopt" (ptr addrspace(1) %ptr, i32 undef)] 29 %a = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %tok, i32 0, i32 1) 30 call void (...) @use(ptr addrspace(1) %a) 31 ret void 32} 33