[llvm-commits] [llvm] r119511 - in /llvm/trunk: lib/MC/MCParser/AsmParser.cpp test/MC/ELF/n_bytes.s
Rafael Espindola
rafael.espindola at gmail.com
Wed Nov 17 08:15:42 PST 2010
Author: rafael
Date: Wed Nov 17 10:15:42 2010
New Revision: 119511
URL: http://llvm.org/viewvc/llvm-project?rev=119511&view=rev
Log:
Add support for .2byte, .4byte and .8byte.
Fixes PR8631.
Added:
llvm/trunk/test/MC/ELF/n_bytes.s
Modified:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=119511&r1=119510&r2=119511&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Wed Nov 17 10:15:42 2010
@@ -947,10 +947,16 @@
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")
Added: llvm/trunk/test/MC/ELF/n_bytes.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/n_bytes.s?rev=119511&view=auto
==============================================================================
--- llvm/trunk/test/MC/ELF/n_bytes.s (added)
+++ llvm/trunk/test/MC/ELF/n_bytes.s Wed Nov 17 10:15:42 2010
@@ -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: ),
More information about the llvm-commits
mailing list