1 # Verifies that llvm-bolt prints correct loop information.
3 RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
4 RUN: %p/Inputs/loop_nest.s -o %t.o
5 RUN: link_fdata %p/Inputs/loop_nest.s %t.o %t.fdata --nmtool llvm-nm
6 RUN: llvm-strip --strip-unneeded %t.o
7 RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
9 RUN: llvm-bolt %t.exe -o %t --data=%t.fdata \
10 RUN: --print-cfg --print-loops --sequential-disassembly --lite=0 \
11 RUN: 2>&1 | FileCheck %s
13 CHECK: Binary Function "main{{.*}}" after building cfg
14 CHECK: Loop Info for Function "main{{.*}}"
15 CHECK: Outer loop header: .Ltmp[[#MAIN_OUTER_HDR:]]
16 CHECK-NEXT: Loop basic blocks: .Ltmp[[#MAIN_OUTER_HDR]], .Ltmp[[#]]
18 CHECK: Binary Function "foo" after building cfg
19 CHECK: Loop Info for Function "foo"
20 CHECK: Outer loop header: .Ltmp[[#FOO_OUTER_HDR:]]
21 CHECK-NEXT: Loop basic blocks: .Ltmp[[#FOO_OUTER_HDR]], .Ltmp[[#]], .LFT[[#]], .Ltmp[[#]], .Ltmp[[#FOO_INNER_HDR:]], .Ltmp[[#]], .Ltmp[[#FOO_INNER_BB:]]
22 CHECK: Nested loop header: .Ltmp[[#FOO_INNER_HDR]]
23 CHECK-NEXT: Loop basic blocks: .Ltmp[[#FOO_INNER_HDR]], .Ltmp[[#FOO_INNER_BB]]