diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-17 16:15:42 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-17 16:15:42 +0000 |
commit | 5c996894bd314601be9c616368b56bea0de19904 (patch) | |
tree | 00cb0b7872ad09304eb67d8280e1a2d6ef0172b3 /llvm | |
parent | 95d37be1a90f65bfb80c0fc36c6029f33dd27cb2 (diff) | |
download | bcm5719-llvm-5c996894bd314601be9c616368b56bea0de19904.tar.gz bcm5719-llvm-5c996894bd314601be9c616368b56bea0de19904.zip |
Add support for .2byte, .4byte and .8byte.
Fixes PR8631.
llvm-svn: 119511
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 6 | ||||
-rw-r--r-- | llvm/test/MC/ELF/n_bytes.s | 20 |
2 files changed, 26 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index cbd181052f4..38b7b276c10 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -947,10 +947,16 @@ bool AsmParser::ParseStatement() { return ParseDirectiveValue(2); if (IDVal == ".value") return ParseDirectiveValue(2); + if (IDVal == ".2byte") + return ParseDirectiveValue(2); if (IDVal == ".long") return ParseDirectiveValue(4); + if (IDVal == ".4byte") + return ParseDirectiveValue(4); if (IDVal == ".quad") return ParseDirectiveValue(8); + if (IDVal == ".8byte") + return ParseDirectiveValue(8); if (IDVal == ".single") return ParseDirectiveRealValue(APFloat::IEEEsingle); if (IDVal == ".double") diff --git a/llvm/test/MC/ELF/n_bytes.s b/llvm/test/MC/ELF/n_bytes.s new file mode 100644 index 00000000000..3a8df99edab --- /dev/null +++ b/llvm/test/MC/ELF/n_bytes.s @@ -0,0 +1,20 @@ +// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump --dump-section-data | FileCheck %s + + .2byte 42, 1, 2, 3 + .4byte 42, 1, 2, 3 + .8byte 42, 1, 2, 3 + + +// CHECK: # Section 0x00000001 +// CHECK-NEXT: (('sh_name', 0x00000001) # '.text' +// CHECK-NEXT: ('sh_type', 0x00000001) +// CHECK-NEXT: ('sh_flags', 0x00000006) +// CHECK-NEXT: ('sh_addr', 0x00000000) +// CHECK-NEXT: ('sh_offset', 0x00000040) +// CHECK-NEXT: ('sh_size', 0x00000038) +// CHECK-NEXT: ('sh_link', 0x00000000) +// CHECK-NEXT: ('sh_info', 0x00000000) +// CHECK-NEXT: ('sh_addralign', 0x00000004) +// CHECK-NEXT: ('sh_entsize', 0x00000000) +// CHECK-NEXT: ('_section_data', '2a000100 02000300 2a000000 01000000 02000000 03000000 2a000000 00000000 01000000 00000000 02000000 00000000 03000000 00000000') +// CHECK-NEXT: ), |