Merging r226905:

------------------------------------------------------------------------
r226905 | tomatabacu | 2015-01-23 10:40:19 +0000 (Fri, 23 Jan 2015) | 18 lines

[mips] Add new error message and improve testing for parsing the .module directive.

Summary:
We used to silently ignore any empty .module's and we used to give an error saying that we found
an "unexpected token at start of statement" when the value of the option wasn't an identifier (e.g. if it was a number).

We now give an error saying that we "expected .module option identifier" in both of those cases.

I also fixed the other tests in mips-abi-bad.s, which all seemed to be broken.


Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D7095
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_36@235856 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Sanders committed 2015-04-27 09:44:39 +00:00
1 parent b37cecaa03
commit fc85d2fe4b
2 files changed
+59 -48

No files matched your search

+23 -13
View File
@@ -1,20 +1,30 @@
# Error checking for malformed abi related directives
# RUN: not llvm-mc -triple mips-unknown-unknown %s 2>&1 | FileCheck %s
# CHECK: .text
# Error checking for malformed .module directives (and .set fp=...).
.module fp=3
# CHECK : mips-abi-bad.s:4:16: error: unsupported option
# CHECK-NEXT : .module fp=3
# CHECK-NEXT : ^
# CHECK: :[[@LINE-1]]:17: error: unsupported value, expected 'xx', '32' or '64'
# CHECK-NEXT: .module fp=3
# CHECK-NEXT: ^
# FIXME: Add separate test for .set fp=xx/32/64.
.set fp=xx,6
# CHECK :mips-abi-bad.s:5:15: error: unexpected token in statement
# CHECK-NEXT : .set fp=xx,6
# CHECK-NEXT : ^
# CHECK: :[[@LINE-1]]:15: error: unexpected token, expected end of statement
# CHECK-NEXT: .set fp=xx,6
# CHECK-NEXT: ^
.module
# CHECK: :[[@LINE-1]]:12: error: expected .module option identifier
# CHECK-NEXT: .module
# CHECK-NEXT: ^
.module 34
# CHECK: :[[@LINE-1]]:13: error: expected .module option identifier
# CHECK-NEXT: .module 34
# CHECK-NEXT: ^
# CHECK :.set mips16
.set mips16
.module fp=32
# CHECK :mips-abi-bad.s:14:13: error: .module directive must come before any code
# CHECK-NEXT : .module fp=32
# CHECK-NEXT : ^
# CHECK: :[[@LINE-1]]:13: error: .module directive must appear before any code
# CHECK-NEXT: .module fp=32
# CHECK-NEXT: ^