• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -thinlto-bc -thinlto-split-lto-unit -o %t0.bc %s
2; RUN: llvm-lto2 run -r %t0.bc,__imp_f,l \
3; RUN:               -r %t0.bc,g,p \
4; RUN:               -r %t0.bc,g,l \
5; RUN:               -r %t0.bc,e,l \
6; RUN:               -r %t0.bc,main,x \
7; RUN:               -save-temps -o %t1 %t0.bc
8; RUN: llvm-dis %t1.1.3.import.bc -o - | FileCheck %s
9source_filename = "test.cpp"
10target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
11target triple = "x86_64-unknown-linux-gnu"
12
13$g = comdat any
14@g = global i8 42, comdat, !type !0
15
16; CHECK: define available_externally dllimport i8* @f()
17define available_externally dllimport i8* @f() {
18  ret i8* @g
19}
20
21define i8* @e() {
22  ret i8* @g
23}
24
25define i32 @main() {
26  %1 = call i8* @f()
27  %2 = ptrtoint i8* %1 to i32
28  ret i32 %2
29}
30!0 = !{i32 0, !"typeid"}
31