Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86][MC] no error diagnostic for out-of-range jrcxz/jecxz/jcxz
Fix for PR24072: X86 instructions jrcxz/jecxz/jcxz performs short jumps if rcx/ecx/cx register is 0 The maximum relative offset for a forward short jump is 127 Bytes (0x7F). The maximum relative offset for a backward short jump is 128 Bytes (0x80). Gnu assembler warns when the distance of the jump exceeds the maximum but llvm-as does not. Patch by Konstantin Belochapka and Alexey Lapshin Differential Revision: https://reviews.llvm.org/D70652
- Loading branch information
Showing
3 changed files
with
48 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ L0: | |
.text | ||
_f0: | ||
L1: | ||
jmp 0xbabecafe | ||
jmp 0x7abecafe | ||
jmp L0 | ||
jmp L1 | ||
ret | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# RUN: not llvm-mc -filetype=obj -triple=x86_64-linux-gnu %s 2>&1 | FileCheck %s | ||
|
||
.balign 128 | ||
label00: | ||
// CHECK: value of 253 is too large for field of 1 byte. | ||
jecxz label01 | ||
// CHECK: value of 251 is too large for field of 1 byte. | ||
jrcxz label01 | ||
// CHECK: value of 249 is too large for field of 1 byte. | ||
loop label01 | ||
// CHECK: value of 247 is too large for field of 1 byte. | ||
loope label01 | ||
// CHECK: value of 245 is too large for field of 1 byte. | ||
loopne label01 | ||
.balign 256 | ||
label01: | ||
// CHECK: value of -259 is too large for field of 1 byte. | ||
jecxz label00 | ||
// CHECK: value of -261 is too large for field of 1 byte. | ||
jrcxz label00 | ||
// CHECK: value of -263 is too large for field of 1 byte. | ||
loop label00 | ||
// CHECK: value of -265 is too large for field of 1 byte. | ||
loope label00 | ||
// CHECK: value of -267 is too large for field of 1 byte. | ||
loopne label00 |