Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DPWBS-1414] Add suppot for .word and .hword directives
- Loading branch information
Edgar Solymosi
committed
Mar 27, 2020
1 parent
9ae52d2
commit 63e2661
Showing
3 changed files
with
82 additions
and
0 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,19 @@ | ||
# RUN: not llvm-mc -arch=tricore -filetype=obj < %s -o /dev/null 2>&1 \ | ||
# RUN: | FileCheck -check-prefix=CHECK %s | ||
|
||
# CHECK: [[@LINE+1]]:7: error: out of range literal value in '.byte' directive | ||
.byte 0xffa | ||
# 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,58 @@ | ||
# RUN: llvm-mc -filetype=obj -triple tricore < %s \ | ||
# RUN: | llvm-objdump -s - | FileCheck %s | ||
|
||
# Test data directives with non-literal arguments | ||
|
||
# CHECK: Contents of section .strtab: | ||
# CHECK-NEXT: ..rela.text..str | ||
# CHECK-NEXT: tab..symtab..dat | ||
# CHECK-NEXT: a.L.BE.LA. | ||
.word LA | ||
.long BE | ||
.4byte L | ||
|
||
# Test data directives with literal arguments | ||
|
||
.data | ||
# CHECK: Contents of section .data: | ||
# CHECK-NEXT: aabbbbcc ccccccbb bbcccccc ccbbbbaa | ||
.byte 0xaa | ||
.hword 0xbbbb | ||
.word 0xcccccccc | ||
.2byte 0xbbbb | ||
.4byte 0xcccccccc | ||
.short 0xbbbb | ||
.byte 0xaa | ||
|
||
# CHECK-NEXT: aacccccc ccdddddd dddddddd ddbbbbaa | ||
.byte 0xaa | ||
.long 0xcccccccc | ||
.8byte 0xdddddddddddddddd | ||
.short 0xbbbb | ||
.byte 0xaa | ||
|
||
# CHECK-NEXT: bs.h.2.w...l...4 | ||
.byte 'b' | ||
.short 's' | ||
.hword 'h' | ||
.2byte '2' | ||
.word 'w' | ||
.long 'l' | ||
.4byte '4' | ||
|
||
# CHECK-NEXT: ...8....... | ||
.8byte '8' | ||
|
||
# Test data directives with no operands | ||
|
||
# CHECK: Contents of section .symtab: | ||
# CHECK-NEXT: 00000000 00000000 00000000 00000000 | ||
.byte | ||
.short | ||
.hword | ||
.2byte | ||
.word | ||
.long | ||
.4byte | ||
.8byte | ||
|