34 lines · plain
1## Check that BOLT handles code with jrcxz instruction that has a one-byte2## signed offset restriction. If we try to separate jrcxz instruction from its3## destination, e.g. by placing it in a different code fragment, then the link4## step will fail.5 6# REQUIRES: system-linux7 8# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o9# RUN: link_fdata %s %t.o %t.fdata10# RUN: llvm-strip --strip-unneeded %t.o11# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q12 13## Disable relocation mode to leave main fragment in its original location.14 15# RUN: llvm-bolt %t.exe -o %t.bolt --data %t.fdata --reorder-blocks=ext-tsp \16# RUN: --split-functions --relocs=017 18 .text19 .globl main20 .type main,@function21main:22# FDATA: 0 [unknown] 0 1 main 0 0 123# FDATA: 1 main 0 1 main #.hot# 0 124.cfi_startproc25 jrcxz .Lcold26.hot:27 ret28 29.Lcold:30 xorl %eax,%eax31 ret32.cfi_endproc33.size main,.-main34