Skip to content

Commit 934d4fe

Browse files
committed
[ThinLTO] Don't rely on debug output for thinlto_samplepgo_icp3 test
Because using -print-imports is not thread-safe, make the test rely on llvm-dis instead. Also cover the ICALL-PROM part as intended originally. Differential Revision: https://reviews.llvm.org/D76775
1 parent 13d267e commit 934d4fe

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

llvm/test/Transforms/PGOProfile/thinlto_samplepgo_icp3.ll

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66

77
; Test to make sure importing and dead stripping works in the
88
; case where the target is a local function that also indirectly calls itself.
9-
; RUN: llvm-lto2 run -thinlto-threads=1 -save-temps -o %t3 %t.bc %t2.bc -r %t.bc,fptr,plx -r %t.bc,main,plx -r %t2.bc,_Z6updatei,pl -r %t2.bc,fptr,l -print-imports 2>&1 | FileCheck %s --check-prefix=IMPORTS
9+
; RUN: llvm-lto2 run -thinlto-threads=1 -save-temps -o %t3 %t.bc %t2.bc -r %t.bc,fptr,plx -r %t.bc,main,plx -r %t2.bc,_Z6updatei,pl -r %t2.bc,fptr,l
10+
; RUN: llvm-dis %t3.1.3.import.bc -o - | FileCheck %s --check-prefix=IMPORTS
11+
1012
; Make sure we import the promted indirectly called target
11-
; IMPORTS: Import _ZL3foov.llvm.0
13+
; IMPORTS: void @_ZL3foov.llvm.0()
14+
15+
; RUN: llvm-dis %t3.2.4.opt.bc -o - | FileCheck %s --check-prefix=ICALL-PROM
16+
; ICALL-PROM: br i1 %{{[0-9]+}}, label %tailrecurse, label %if.false.orig_indirect,
17+
1218

1319
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
1420
target triple = "x86_64-unknown-linux-gnu"
@@ -19,7 +25,6 @@ target triple = "x86_64-unknown-linux-gnu"
1925
define i32 @main() local_unnamed_addr #0 !prof !34 {
2026
entry:
2127
%0 = load void ()*, void ()** @fptr, align 8
22-
; ICALL-PROM: br i1 %{{[0-9]+}}, label %if.true.direct_targ, label %if.false.orig_indirect
2328
tail call void %0(), !prof !40
2429
ret i32 0
2530
}

0 commit comments

Comments
 (0)