forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LTO: Hash the set of imported symbols for each module.
This set may affect code generation and is sensitive to link order (and possibly in the future to the linker's choice of prevailing symbol), so we need to include it. Differential Revision: https://reviews.llvm.org/D30586 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296907 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
4 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-unknown-linux-gnu" | ||
|
||
define void @f1() { | ||
call void @linkonce_odr() | ||
ret void | ||
} | ||
|
||
define linkonce_odr void @linkonce_odr() { | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-unknown-linux-gnu" | ||
|
||
define void @f2() { | ||
call void @linkonce_odr() | ||
ret void | ||
} | ||
|
||
define linkonce_odr void @linkonce_odr() { | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
; RUN: opt -module-hash -module-summary %s -o %t.bc | ||
; RUN: opt -module-hash -module-summary %S/Inputs/cache-import-lists1.ll -o %t1.bc | ||
; RUN: opt -module-hash -module-summary %S/Inputs/cache-import-lists2.ll -o %t2.bc | ||
|
||
; Tests that the hash for t is sensitive to the set of imported functions | ||
; for each module, which in this case depends on the link order (the function | ||
; linkonce_odr will be imported from either t1 or t2, whichever comes first). | ||
|
||
; RUN: rm -rf %t.cache | ||
; RUN: llvm-lto2 -cache-dir %t.cache -o %t.o %t.bc %t1.bc %t2.bc -r=%t.bc,main,plx -r=%t.bc,f1,lx -r=%t.bc,f2,lx -r=%t1.bc,f1,plx -r=%t1.bc,linkonce_odr,plx -r=%t2.bc,f2,plx -r=%t2.bc,linkonce_odr,lx | ||
; RUN: llvm-lto2 -cache-dir %t.cache -o %t.o %t.bc %t2.bc %t1.bc -r=%t.bc,main,plx -r=%t.bc,f1,lx -r=%t.bc,f2,lx -r=%t2.bc,f2,plx -r=%t2.bc,linkonce_odr,plx -r=%t1.bc,f1,plx -r=%t1.bc,linkonce_odr,lx | ||
; RUN: ls %t.cache | count 6 | ||
|
||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-unknown-linux-gnu" | ||
|
||
define void @main() { | ||
call void @f1() | ||
call void @f2() | ||
ret void | ||
} | ||
|
||
declare void @f1() | ||
declare void @f2() |