Skip to content

Commit f8fe619

Browse files
committed
Check thin LTO case
1 parent c973056 commit f8fe619

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

llvm/test/tools/gold/X86/unified-lto.ll

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
; RUN: -o %t-out
1212
; RUN: llvm-dis %t-out.0.5.precodegen.bc -o - | FileCheck %s
1313

14+
; Check thin LTO as well
15+
; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext \
16+
; RUN: -m elf_x86_64 \
17+
; RUN: -plugin-opt=unifiedlto \
18+
; RUN: -plugin-opt=thinlto \
19+
; RUN: -plugin-opt=save-temps \
20+
; RUN: -u main \
21+
; RUN: %t.bc %t-foo.bc \
22+
; RUN: -o %t-out
23+
; RUN: llvm-dis %t.bc.5.precodegen.bc -o - | FileCheck %s --check-prefix=THIN
24+
1425
; Constant propagation is not supported by thin LTO.
1526
; With full LTO we fold argument into constant 43
1627
; CHECK: define dso_local noundef i32 @main()
@@ -20,6 +31,10 @@
2031
; CHECK: define internal fastcc void @foo()
2132
; CHECK-NEXT: store i32 43, ptr @_g, align 4
2233

34+
; ThinLTO doesn't import foo, because the latter has noinline attribute
35+
; THIN: define dso_local i32 @main()
36+
; THIN-NEXT: %1 = tail call i32 @foo(i32 noundef 1)
37+
2338
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
2439
target triple = "x86_64-pc-linux-gnu"
2540

0 commit comments

Comments
 (0)