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
; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t %s
; RUN: llvm-lto2 run -r %t,f,plx -r %t,g_alias,plx -r %t,foo,lx -r %t,foo,plx -r %t,bar,lx -r %t,bar,plx -o %t1 %t
; RUN: llvm-nm %t1.0 | FileCheck --check-prefix=MERGED %s
; RUN: llvm-nm %t1.1 | FileCheck %s

; MERGED: R __typeid_bar_global_addr
; MERGED: R __typeid_foo_global_addr
; CHECK: U __typeid_bar_global_addr
; CHECK: U __typeid_foo_global_addr

target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@foo = global i32 0, !type !0
@bar = global i32 0, !type !1

define i1 @f(i8* %ptr) {
  %p = call i1 @llvm.type.test(i8* %ptr, metadata !"foo")
  ret i1 %p
}

@g_alias = alias i1 (i8*), i1 (i8*)* @g

define internal i1 @g(i8* %ptr) {
  %p = call i1 @llvm.type.test(i8* %ptr, metadata !"bar")
  ret i1 %p
}

declare i1 @llvm.type.test(i8* %ptr, metadata %typeid) nounwind readnone

!0 = !{i32 0, !"foo"}
!1 = !{i32 0, !"bar"}