llvm.org GIT mirror llvm / 6abfc44
Parse Tag_compatibility correctly. Tag_compatibility takes two arguments, but before this patch it would erroneously accept just one, it now produces an error in that case. Change-Id: I530f918587620d0d5dfebf639944d6083871ef7d git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225167 91177308-0d34-0410-b5e6-96231b3b80d8 Charlie Turner 5 years ago
4 changed file(s) with 12 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
91299129 if (Tag == ARMBuildAttrs::compatibility) {
91309130 if (Parser.getTok().isNot(AsmToken::Comma))
91319131 IsStringValue = false;
9132 else
9133 Parser.Lex();
9132 if (Parser.getTok().isNot(AsmToken::Comma)) {
9133 Error(Parser.getTok().getLoc(), "comma expected");
9134 Parser.eatToEndOfStatement();
9135 return false;
9136 } else {
9137 Parser.Lex();
9138 }
91349139 }
91359140
91369141 if (IsStringValue) {
2828 @ CHECK: .eabi_attribute 0
2929 @ CHECK: ^
3030
31 .eabi_attribute Tag_compatibility, 1
32 @ CHECK: error: comma expected
33 @ CHECK: .eabi_attribute Tag_compatibility, 1
34 @ CHECK: ^
35
3136 .eabi_attribute Tag_MPextension_use_old, 0
3237 @ CHECK: error: attribute name not recognised: Tag_MPextension_use_old
3338 @ CHECK: .eabi_attribute Tag_MPextension_use_old, 0
22
33 .syntax unified
44 .thumb
5 @ FIXME: The next directive is not correct, Tag_compatibility isn't getting parsed correctly.
6 .eabi_attribute Tag_compatibility, 1
75 .eabi_attribute Tag_compatibility, 1, "aeabi"
86
97 @ CHECK-ATTR: FileAttributes {
172172 @ CHECK-OBJ-NEXT: Value: 1
173173 @ CHECK-OBJ-NEXT: TagName: ABI_FP_optimization_goals
174174 @ CHECK-OBJ-NEXT: Description: Speed
175 .eabi_attribute Tag_compatibility, 1
176 @ CHECK: .eabi_attribute 32, 1
177175 .eabi_attribute Tag_compatibility, 1, "aeabi"
178176 @ CHECK: .eabi_attribute 32, 1, "aeabi"
179177 @ CHECK-OBJ: Tag: 32