reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
; RUN: opt < %s -globalopt -S | FileCheck %s
; PR36546

; Check that musttail callee preserves its calling convention

define i32 @test(i32 %a) {
  ; CHECK: %ca = musttail call i32 @foo(i32 %a)
  %ca = musttail call i32 @foo(i32 %a)
  ret i32 %ca
}

; CHECK-LABEL: define internal i32 @foo(i32 %a)
define internal i32 @foo(i32 %a) {
  ret i32 %a
}

; Check that musttail caller preserves its calling convention

define i32 @test2(i32 %a) {
  %ca = call i32 @foo1(i32 %a)
  ret i32 %ca
}

; CHECK-LABEL: define internal i32 @foo1(i32 %a)
define internal i32 @foo1(i32 %a) {
  ; CHECK: %ca = musttail call i32 @foo2(i32 %a)
  %ca = musttail call i32 @foo2(i32 %a)
  ret i32 %ca
}

; CHECK-LABEL: define internal i32 @foo2(i32 %a)
define internal i32 @foo2(i32 %a) {
  ret i32 %a
}