xref: /llvm-project/lld/test/MachO/lto-save-temps.ll (revision fd28f71872f74cfa23f676e87e1c27c4431d6dfa)
1; REQUIRES: x86
2
3; Test that we compile regular LTO inputs in a single task but handle ThinLTO
4; modules in separate tasks.
5
6; RUN: rm -rf %t; split-file %s %t
7; RUN: llvm-as %t/foo.ll -o %t/foo.o
8; RUN: llvm-as %t/bar.ll -o %t/bar.o
9; RUN: %lld -dylib -save-temps %t/foo.o %t/bar.o -o %t/test
10; RUN: llvm-objdump -d --no-show-raw-insn %t/test.lto.o | FileCheck %s --check-prefix=ALL
11; RUN: llvm-objdump -d --no-show-raw-insn %t/test | FileCheck %s --check-prefix=ALL
12
13; RUN: rm -rf %t; split-file %s %t
14; RUN: opt -module-summary %t/foo.ll -o %t/foo.o
15; RUN: opt -module-summary %t/bar.ll -o %t/bar.o
16; RUN: %lld -dylib -save-temps %t/foo.o %t/bar.o -o %t/test
17; RUN: llvm-objdump -d --no-show-raw-insn %t/test1.lto.o | FileCheck %s --check-prefix=FOO
18; RUN: llvm-objdump -d --no-show-raw-insn %t/test2.lto.o | FileCheck %s --check-prefix=MAIN
19; RUN: llvm-objdump -d --no-show-raw-insn %t/test | FileCheck %s --check-prefix=ALL
20
21; FOO:      <_foo>:
22; FOO-NEXT: retq
23
24; MAIN:      <_bar>:
25; MAIN-NEXT: retq
26
27; ALL:      <_foo>:
28; ALL-NEXT: retq
29; ALL:      <_bar>:
30; ALL-NEXT: retq
31
32;--- foo.ll
33
34target triple = "x86_64-apple-macosx10.15.0"
35target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
36
37define void @foo() {
38  ret void
39}
40
41;--- bar.ll
42
43target triple = "x86_64-apple-macosx10.15.0"
44target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
45
46define void @bar() {
47  ret void
48}
49