xref: /llvm-project/lld/test/ELF/lto/unified-lto.ll (revision ab9b3c84a588f86e7f66eeb577bea7155817ff06)
1; REQUIRES: x86
2; RUN: opt -thinlto-bc -thinlto-split-lto-unit -unified-lto %s -o %t0.o
3; RUN: opt -thinlto-bc -thinlto-split-lto-unit %s -o %t1.o
4; RUN: ld.lld --lto=full %t0.o -o %t0
5; RUN: llvm-readelf -s %t0 | FileCheck %s --check-prefix=FULL
6; RUN: ld.lld --lto=thin %t0.o -o %t0
7; RUN: llvm-readelf -s %t0 | FileCheck %s --check-prefix=THIN
8; RUN: ld.lld --lto=default %t0.o -o %t0
9; RUN: llvm-readelf -s %t0 | FileCheck %s --check-prefix=THIN
10; RUN: ld.lld --lto=default %t1.o -o %t1
11; RUN: llvm-readelf -s %t1 | FileCheck %s --check-prefix=THIN
12; RUN: ld.lld %t0.o -o %t0 2>&1 | count 0
13; RUN: llvm-readelf -s %t0 | FileCheck %s --check-prefix=THIN
14; RUN: not ld.lld --lto=unknown %t1.o -o /dev/null 2>&1 | \
15; RUN:   FileCheck --implicit-check-not=error: --check-prefix=ERR %s
16; ERR: error: unknown LTO mode: unknown
17
18; FULL:      Symbol table '.symtab' contains 3 entries:
19; FULL-NEXT: Num:    Value          Size Type    Bind   Vis       Ndx Name
20; FULL-NEXT: 0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT   UND
21; FULL-NEXT: 1: 0000000000000000     0 FILE    LOCAL  DEFAULT   ABS ld-temp.o
22; FULL-NEXT: 2: 0000000000201120     1 FUNC    GLOBAL DEFAULT     1 _start
23
24; THIN:      Symbol table '.symtab' contains 3 entries:
25; THIN-NEXT: Num:    Value          Size Type    Bind   Vis       Ndx Name
26; THIN-NEXT: 0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT   UND
27; THIN-NEXT: 1: 0000000000000000     0 FILE    LOCAL  DEFAULT   ABS unified-lto.ll
28; THIN-NEXT: 2: 0000000000201120     1 FUNC    GLOBAL DEFAULT     1 _start
29
30target triple = "x86_64-unknown-linux-gnu"
31target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
32
33define void @_start() {
34  ret void
35}
36