Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Hexagon] Use addAliasForDirective for data directives
Data directives such as .word, .half, .hword are currently parsed using HexagonAsmParser::ParseDirectiveValue which effectively duplicates logic from AsmParser::parseDirectiveValue. This patch deletes that duplicated logic in favour of using addAliasForDirective. Differential Revision: https://reviews.llvm.org/D46999 llvm-svn: 332607
- Loading branch information
Showing
3 changed files
with
49 additions
and
39 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# RUN: not llvm-mc -triple hexagon < %s 2>&1 | FileCheck %s | ||
|
||
# CHECK: [[@LINE+1]]:7: error: out of range literal value in '.byte' directive | ||
.byte 0xffa | ||
# CHECK: [[@LINE+1]]:7: error: out of range literal value in '.half' directive | ||
.half 0xffffa | ||
# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.short' directive | ||
.short 0xffffa | ||
# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.hword' directive | ||
.hword 0xffffa | ||
# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.2byte' directive | ||
.2byte 0xffffa | ||
# CHECK: [[@LINE+1]]:7: error: out of range literal value in '.word' directive | ||
.word 0xffffffffa | ||
# CHECK: [[@LINE+1]]:7: error: out of range literal value in '.long' directive | ||
.long 0xffffffffa | ||
# CHECK: [[@LINE+1]]:8: error: out of range literal value in '.4byte' directive | ||
.4byte 0xffffffffa | ||
# CHECK: [[@LINE+1]]:8: error: literal value out of range for directive in '.8byte' directive | ||
.8byte 0xffffffffffffffffa |
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,25 @@ | ||
# RUN: llvm-mc -filetype=obj -triple hexagon < %s \ | ||
# RUN: | llvm-objdump -s - | FileCheck %s | ||
|
||
.data | ||
|
||
# CHECK: Contents of section .data: | ||
# CHECK-NEXT: 0000 deadbeef badcaf11 22334455 66778800 | ||
.byte 0xde | ||
.half 0xbead | ||
.word 0xafdcbaef | ||
.8byte 0x8877665544332211 | ||
.byte 0 | ||
|
||
# CHECK-NEXT: 0010 deadbeef badcaf11 22334455 66778800 | ||
.byte 0xde | ||
.2byte 0xbead | ||
.4byte 0xafdcbaef | ||
.8byte 0x8877665544332211 | ||
.byte 0 | ||
|
||
# CHECK-NEXT: 0020 deadbeef badcaf11 22 | ||
.byte 0xde | ||
.short 0xbead | ||
.long 0xafdcbaef | ||
.hword 0x2211 |