1 ; RUN: opt -module-summary %s -o %t1.bc
2 ; RUN: opt -module-summary %p/Inputs/globals-import-blockaddr.ll -o %t2.bc
3 ; RUN: llvm-lto2 run -save-temps %t1.bc -r=%t1.bc,foo,l -r=%t1.bc,bar,l -r=%t1.bc,main,pl %t2.bc -r=%t2.bc,foo,pl -r=%t2.bc,bar,pl -o %t3
4 ; RUN: llvm-dis %t3.1.3.import.bc -o - | FileCheck %s
6 ; Verify that we haven't imported GV containing blockaddress
7 ; CHECK: @label_addr.llvm.0 = external hidden constant
8 ; Verify that bar is not imported since it has address-taken block that is target of indirect branch
9 ; CHECK: declare ptr @bar()
10 ; Verify that foo is imported
11 ; CHECK: available_externally ptr @foo
13 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
14 target triple = "x86_64-unknown-linux-gnu"
16 declare dso_local ptr @foo();
17 declare dso_local ptr @bar();
19 define dso_local i32 @main() {
22 %v1 = ptrtoint ptr %p1 to i32
23 %v2 = ptrtoint ptr %p2 to i32
24 %v3 = add i32 %v1, %v2