From 1e840b2c6150838815c1041562f9876560b0b465 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 11 Aug 2009 04:44:00 +0000 Subject: [PATCH] llvm-mc: Accept .word as a synonym for .short git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78641 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/MC/AsmParser/directive_values.s | 5 +++++ tools/llvm-mc/AsmParser.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/MC/AsmParser/directive_values.s b/test/MC/AsmParser/directive_values.s index beac69a4aeb..900fb7386d0 100644 --- a/test/MC/AsmParser/directive_values.s +++ b/test/MC/AsmParser/directive_values.s @@ -19,3 +19,8 @@ TEST2: # CHECK: .quad 9 TEST3: .quad 9 + +# CHECK: TEST4: +# CHECK: .short 3 +TEST4: + .word 3 diff --git a/tools/llvm-mc/AsmParser.cpp b/tools/llvm-mc/AsmParser.cpp index b766830bf14..eec4cc8829b 100644 --- a/tools/llvm-mc/AsmParser.cpp +++ b/tools/llvm-mc/AsmParser.cpp @@ -517,7 +517,7 @@ bool AsmParser::ParseStatement() { // FIXME: Target hooks for size? Also for "word", "hword". if (IDVal == ".byte") return ParseDirectiveValue(1); - if (IDVal == ".short") + if (IDVal == ".short" || IDVal == ".word") return ParseDirectiveValue(2); if (IDVal == ".long") return ParseDirectiveValue(4); -- 2.34.1