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; Check that -save-temps is usable with thin archives 25; RUN: rm -fr %t.dir 26; RUN: mkdir -p %t.dir 27; RUN: cp %t2.o %t.dir/t.o 28; RUN: llvm-ar rcsT %t.dir/t.a %t.dir/t.o 29; RUN: ld.lld -save-temps %t1.o %t.dir/t.a -o %t.null 30; RUN: ls '%t.dir/t.a(t.o at 0).0.preopt.bc' 31 32; NM1: T f 33; NM2: T g 34 35target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 36target triple = "x86_64-unknown-linux-gnu" 37 38declare void @g(...) 39 40define void @f() { 41entry: 42 call void (...) @g() 43 ret void 44} 45