1 ; RUN: split-file %s %t
3 ; RUN: opt -module-summary %t/av_ext_def.ll -o %t/av_ext_def.bc
4 ; RUN: opt -module-summary %t/weak_def.ll -o %t/weak_def.bc
5 ; RUN: llvm-lto2 run -o %t/prevailing_import -save-temps %t/av_ext_def.bc %t/weak_def.bc \
6 ; RUN: -r=%t/av_ext_def.bc,ret_av_ext_def,px -r=%t/av_ext_def.bc,def,x \
7 ; RUN: -r=%t/weak_def.bc,ret_weak_def,px -r=%t/weak_def.bc,def,px
8 ; RUN: llvm-dis %t/prevailing_import.2.3.import.bc -o - | FileCheck --match-full-lines --check-prefix=WEAK_DEF %s
9 ; RUN: llvm-nm -jU %t/prevailing_import.2 | FileCheck --match-full-lines --check-prefix=NM %s
11 ;; def should remain weak after function importing in the weak_def module
12 ; WEAK_DEF: @def = weak constant i32 0
14 ;; It should also be defined in the corresponding object file
18 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
19 target triple = "x86_64-unknown-linux-gnu"
20 @def = available_externally constant i32 0
21 define ptr @ret_av_ext_def() {
26 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
27 target triple = "x86_64-unknown-linux-gnu"
28 @def = weak constant i32 0
29 define ptr @ret_weak_def() {