xref: /llvm-project/lld/test/MachO/thinlto-jobs.ll (revision 050a7a27ca844a912e46cdfeed7a472847ad0bc9)
1; REQUIRES: x86
2; RUN: rm -rf %t; split-file %s %t
3
4;; I'm not aware of a deterministic way to verify whether LTO is running in
5;; single- or multi-threaded mode. So this test simply checks that we can parse
6;; the --thinlto-jobs flag correctly, but doesn't verify its effect.
7
8; RUN: opt -module-summary %t/f.s -o %t/f.o
9; RUN: opt -module-summary %t/g.s -o %t/g.o
10
11; RUN: %lld --time-trace --thinlto-jobs=1 -dylib %t/f.o %t/g.o -o %t/out
12; RUN: %lld --time-trace --thinlto-jobs=2 -dylib %t/f.o %t/g.o -o %t/out
13; RUN: %lld --thinlto-jobs=all -dylib %t/f.o %t/g.o -o /dev/null
14
15;; Test with a bad value
16; RUN: not %lld --thinlto-jobs=foo -dylib %t/f.o %t/g.o -o /dev/null 2>&1 | FileCheck %s
17; CHECK: error: --thinlto-jobs: invalid job count: foo
18
19;--- f.s
20target triple = "x86_64-apple-darwin"
21target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
22
23declare void @g(...)
24
25define void @f() {
26entry:
27  call void (...) @g()
28  ret void
29}
30
31;--- g.s
32target triple = "x86_64-apple-darwin"
33target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
34
35define void @g() {
36entry:
37  ret void
38}
39