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
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
; RUN: opt -S -lowertypetests < %s | FileCheck %s

target datalayout = "e-p:64:64"
target triple = "x86_64-unknown-linux"

; CHECK: @0 = private constant { i32, [0 x i8], i32 } { i32 1, [0 x i8] zeroinitializer, i32 2 }
; CHECK: @f1 = alias void (), void ()* @.cfi.jumptable
; CHECK: @f2 = alias void (), bitcast ([8 x i8]* getelementptr inbounds ([2 x [8 x i8]], [2 x [8 x i8]]* bitcast (void ()* @.cfi.jumptable to [2 x [8 x i8]]*), i64 0, i64 1) to void ()*)
; CHECK: @g1 = alias i32, getelementptr inbounds ({ i32, [0 x i8], i32 }, { i32, [0 x i8], i32 }* @0, i32 0, i32 0)
; CHECK: @g2 = alias i32, getelementptr inbounds ({ i32, [0 x i8], i32 }, { i32, [0 x i8], i32 }* @0, i32 0, i32 2)

@g1 = constant i32 1
@g2 = constant i32 2

define void @f1() {
  ret void
}

define void @f2() {
  ret void
}

declare void @g1f()
declare void @g2f()

define void @jt2(i8* nest, ...) {
  musttail call void (...) @llvm.icall.branch.funnel(
      i8* %0,
      i32* @g1, void ()* @g1f,
      i32* @g2, void ()* @g2f,
      ...
  )
  ret void
}

define void @jt3(i8* nest, ...) {
  musttail call void (...) @llvm.icall.branch.funnel(
      i8* %0,
      void ()* @f1, void ()* @f1,
      void ()* @f2, void ()* @f2,
      ...
  )
  ret void
}

declare void @llvm.icall.branch.funnel(...)