2017-07-19 02:40:50 +08:00
|
|
|
; REQUIRES: x86
|
2018-05-03 05:40:07 +08:00
|
|
|
|
2016-10-11 02:12:53 +08:00
|
|
|
; Basic ThinLTO tests.
|
2018-05-12 03:37:08 +08:00
|
|
|
; RUN: opt -module-summary %s -o %t1.o
|
2016-10-11 07:56:13 +08:00
|
|
|
; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o
|
2018-05-04 04:13:38 +08:00
|
|
|
|
2016-10-11 02:12:53 +08:00
|
|
|
; First force single-threaded mode
|
2018-05-12 03:37:08 +08:00
|
|
|
; RUN: rm -f %t31.lto.o %t32.lto.o
|
|
|
|
; RUN: ld.lld -save-temps --thinlto-jobs=1 -shared %t1.o %t2.o -o %t3
|
|
|
|
; RUN: llvm-nm %t31.lto.o | FileCheck %s --check-prefix=NM1
|
|
|
|
; RUN: llvm-nm %t32.lto.o | FileCheck %s --check-prefix=NM2
|
2016-10-11 02:12:53 +08:00
|
|
|
|
|
|
|
; Next force multi-threaded mode
|
2018-05-12 03:37:08 +08:00
|
|
|
; RUN: rm -f %t31.lto.o %t32.lto.o
|
|
|
|
; RUN: ld.lld -save-temps --thinlto-jobs=2 -shared %t1.o %t2.o -o %t3
|
|
|
|
; RUN: llvm-nm %t31.lto.o | FileCheck %s --check-prefix=NM1
|
|
|
|
; RUN: llvm-nm %t32.lto.o | FileCheck %s --check-prefix=NM2
|
2016-10-11 02:12:53 +08:00
|
|
|
|
2016-10-11 23:32:34 +08:00
|
|
|
; Then check without --thinlto-jobs (which currently default to hardware_concurrency)
|
2018-05-30 07:32:49 +08:00
|
|
|
; RUN: ld.lld -shared %t1.o %t2.o -o %t3
|
|
|
|
; RUN: llvm-nm %t31.lto.o | FileCheck %s --check-prefix=NM1
|
|
|
|
; RUN: llvm-nm %t32.lto.o | FileCheck %s --check-prefix=NM2
|
2018-05-09 06:37:57 +08:00
|
|
|
|
2018-05-03 05:40:07 +08:00
|
|
|
; NM1: T f
|
|
|
|
; NM2: T g
|
|
|
|
|
2016-10-11 02:12:53 +08:00
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
|
|
|
|
declare void @g(...)
|
|
|
|
|
|
|
|
define void @f() {
|
|
|
|
entry:
|
|
|
|
call void (...) @g()
|
|
|
|
ret void
|
|
|
|
}
|