]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/ELF/lto/thinlto.ll
Vendor import of lld trunk r338150:
[FreeBSD/FreeBSD.git] / test / ELF / lto / thinlto.ll
1 ; REQUIRES: x86
2
3 ; Basic ThinLTO tests.
4 ; RUN: opt -module-summary %s -o %t1.o
5 ; RUN: opt -module-summary %p/Inputs/thinlto.ll -o %t2.o
6
7 ; First force single-threaded mode
8 ; RUN: rm -f %t31.lto.o %t32.lto.o
9 ; RUN: ld.lld -save-temps --thinlto-jobs=1 -shared %t1.o %t2.o -o %t3
10 ; RUN: llvm-nm %t31.lto.o | FileCheck %s --check-prefix=NM1
11 ; RUN: llvm-nm %t32.lto.o | FileCheck %s --check-prefix=NM2
12
13 ; Next force multi-threaded mode
14 ; RUN: rm -f %t31.lto.o %t32.lto.o
15 ; RUN: ld.lld -save-temps --thinlto-jobs=2 -shared %t1.o %t2.o -o %t3
16 ; RUN: llvm-nm %t31.lto.o | FileCheck %s --check-prefix=NM1
17 ; RUN: llvm-nm %t32.lto.o | FileCheck %s --check-prefix=NM2
18
19 ; Then check without --thinlto-jobs (which currently default to hardware_concurrency)
20 ; RUN: ld.lld -shared %t1.o %t2.o -o %t3
21 ; RUN: llvm-nm %t31.lto.o | FileCheck %s --check-prefix=NM1
22 ; RUN: llvm-nm %t32.lto.o | FileCheck %s --check-prefix=NM2
23
24 ; NM1: T f
25 ; NM2: T g
26
27 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
28 target triple = "x86_64-unknown-linux-gnu"
29
30 declare void @g(...)
31
32 define void @f() {
33 entry:
34   call void (...) @g()
35   ret void
36 }