xref: /llvm-project/llvm/test/CodeGen/X86/patchable-prologue-tailcall.ll (revision bb28442c0b9790473363cbca2867630262358018)
1; RUN: llc -verify-machineinstrs -mtriple=x86_64-windows-msvc < %s | FileCheck %s --check-prefix=CHECK
2
3; CHECK: f1:
4; CHECK-NEXT: # %bb.0:
5; CHECK-NEXT: jmp     f0                          # TAILCALL
6
7; CHECK: f2:
8; CHECK-NEXT: # %bb.0:
9; CHECK-NEXT: jmp     malloc                          # TAILCALL
10
11define ptr @f1(i64 %count) "patchable-function"="prologue-short-redirect" {
12entry:
13  %call = tail call ptr @f0(i64 %count)
14  ret ptr %call
15}
16
17declare ptr @f0(i64)
18
19define noalias ptr @f2(i64 %count) "patchable-function"="prologue-short-redirect" {
20entry:
21  %call = tail call ptr @malloc(i64 %count)
22  ret ptr %call
23}
24
25declare noalias ptr @malloc(i64) #0
26
27attributes #0 = { allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
28
29!llvm.module.flags = !{!0, !1, !2, !3}
30
31!0 = !{i32 1, !"wchar_size", i32 2}
32!1 = !{i32 8, !"PIC Level", i32 2}
33!2 = !{i32 7, !"uwtable", i32 2}
34!3 = !{i32 1, !"MaxTLSAlign", i32 65536}
35