54 lines · plain
1# REQUIRES: system-linux2 3# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \4# RUN: %s -o %t.o5# RUN: link_fdata %s %t.o %t.fdata6# RUN: link_fdata %s %t.o %t.fdata2 "FDATA2"7# RUN: link_fdata %s %t.o %t.fdata3 "FDATA3"8# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q9# RUN: llvm-bolt %t.exe --data %t.fdata --reorder-blocks=ext-tsp \10# RUN: --print-finalized --loop-inversion-opt -o %t.out \11# RUN: | FileCheck %s12# RUN: llvm-bolt %t.exe --data %t.fdata2 --reorder-blocks=ext-tsp \13# RUN: --print-finalized --loop-inversion-opt -o %t.out2 \14# RUN: | FileCheck --check-prefix="CHECK2" %s15# RUN: llvm-bolt %t.exe --data %t.fdata3 --reorder-blocks=none \16# RUN: --print-finalized --loop-inversion-opt -o %t.out3 \17# RUN: | FileCheck --check-prefix="CHECK3" %s18 19## The case where the loop is used:20# FDATA: 1 main 2 1 main #.J1# 0 42021# FDATA: 1 main b 1 main #.Jloop# 0 42022# FDATA: 1 main b 1 main d 0 123# CHECK: BB Layout : .LBB00, .Ltmp0, .Ltmp1, .LFT024 25## The case where the loop is unused:26# FDATA2: 1 main 2 1 main #.J1# 0 42027# FDATA2: 1 main b 1 main #.Jloop# 0 128# FDATA2: 1 main b 1 main d 0 42029# CHECK2: BB Layout : .LBB00, .Ltmp1, .LFT0, .Ltmp030 31## The case where the loop does not require rotation:32# FDATA3: 1 main 2 1 main #.J1# 0 42033# FDATA3: 1 main b 1 main #.Jloop# 0 42034# FDATA3: 1 main b 1 main d 0 135# CHECK3: BB Layout : .LBB00, .Ltmp0, .Ltmp1, .LFT036 37 .text38 .globl main39 .type main, %function40 .size main, .Lend-main41main:42 xor %eax, %eax43 jmp .J144.Jloop:45 inc %rax46.J1:47 cmp $16, %rax48 jl .Jloop49 retq50 51# For relocations against .text52 call exit53.Lend:54