1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs < %s | FileCheck %s
3 ; Test to check that Statepoints with X64 far-immediate targets
4 ; are lowered correctly to an indirect call via a scratch register.
6 target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
7 target triple = "x86_64-pc-win64"
9 define void @test_far_call() gc "statepoint-example" {
10 ; CHECK-LABEL: test_far_call:
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: pushq %rax
13 ; CHECK-NEXT: .cfi_def_cfa_offset 16
14 ; CHECK-NEXT: movabsq $140727162896504, %rax # imm = 0x7FFD988E0078
15 ; CHECK-NEXT: callq *%rax
17 ; CHECK-NEXT: popq %rax
18 ; CHECK-NEXT: .cfi_def_cfa_offset 8
22 %safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) inttoptr (i64 140727162896504 to ptr), i32 0, i32 0, i32 0, i32 0)
26 declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)