mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Match case for invalid constant error messages and add a new
test for invalid hexadecimals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129326 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e77f72d7d2
commit
05f9e4e8bd
@ -213,13 +213,13 @@ AsmToken AsmLexer::LexDigit() {
|
|||||||
|
|
||||||
// Requires at least one binary digit.
|
// Requires at least one binary digit.
|
||||||
if (CurPtr == NumStart)
|
if (CurPtr == NumStart)
|
||||||
return ReturnError(TokStart, "Invalid binary number");
|
return ReturnError(TokStart, "invalid binary number");
|
||||||
|
|
||||||
StringRef Result(TokStart, CurPtr - TokStart);
|
StringRef Result(TokStart, CurPtr - TokStart);
|
||||||
|
|
||||||
long long Value;
|
long long Value;
|
||||||
if (Result.substr(2).getAsInteger(2, Value))
|
if (Result.substr(2).getAsInteger(2, Value))
|
||||||
return ReturnError(TokStart, "Invalid binary number");
|
return ReturnError(TokStart, "invalid binary number");
|
||||||
|
|
||||||
// The darwin/x86 (and x86-64) assembler accepts and ignores ULL and LL
|
// The darwin/x86 (and x86-64) assembler accepts and ignores ULL and LL
|
||||||
// suffixes on integer literals.
|
// suffixes on integer literals.
|
||||||
@ -236,11 +236,11 @@ AsmToken AsmLexer::LexDigit() {
|
|||||||
|
|
||||||
// Requires at least one hex digit.
|
// Requires at least one hex digit.
|
||||||
if (CurPtr == NumStart)
|
if (CurPtr == NumStart)
|
||||||
return ReturnError(CurPtr-2, "Invalid hexadecimal number");
|
return ReturnError(CurPtr-2, "invalid hexadecimal number");
|
||||||
|
|
||||||
unsigned long long Result;
|
unsigned long long Result;
|
||||||
if (StringRef(TokStart, CurPtr - TokStart).getAsInteger(0, Result))
|
if (StringRef(TokStart, CurPtr - TokStart).getAsInteger(0, Result))
|
||||||
return ReturnError(TokStart, "Invalid hexadecimal number");
|
return ReturnError(TokStart, "invalid hexadecimal number");
|
||||||
|
|
||||||
// The darwin/x86 (and x86-64) assembler accepts and ignores ULL and LL
|
// The darwin/x86 (and x86-64) assembler accepts and ignores ULL and LL
|
||||||
// suffixes on integer literals.
|
// suffixes on integer literals.
|
||||||
@ -257,7 +257,7 @@ AsmToken AsmLexer::LexDigit() {
|
|||||||
StringRef Result(TokStart, CurPtr - TokStart);
|
StringRef Result(TokStart, CurPtr - TokStart);
|
||||||
long long Value;
|
long long Value;
|
||||||
if (Result.getAsInteger(8, Value))
|
if (Result.getAsInteger(8, Value))
|
||||||
return ReturnError(TokStart, "Invalid octal number");
|
return ReturnError(TokStart, "invalid octal number");
|
||||||
|
|
||||||
// The darwin/x86 (and x86-64) assembler accepts and ignores ULL and LL
|
// The darwin/x86 (and x86-64) assembler accepts and ignores ULL and LL
|
||||||
// suffixes on integer literals.
|
// suffixes on integer literals.
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
// RUN: not llvm-mc -triple x86_64-apple-darwin10 %s 2> %t.err | FileCheck %s
|
// RUN: not llvm-mc -triple x86_64-apple-darwin10 %s 2> %t.err | FileCheck %s
|
||||||
// RUN: FileCheck --check-prefix=CHECK-ERRORS %s < %t.err
|
// RUN: FileCheck --check-prefix=CHECK-ERRORS %s < %t.err
|
||||||
// CHECK: .section __TEXT,__text,regular,pure_instructions
|
// CHECK: .section __TEXT,__text,regular,pure_instructions
|
||||||
// CHECK-ERRORS: error: Invalid octal number
|
// CHECK-ERRORS: error: invalid octal number
|
||||||
.long 80+08
|
.long 80+08
|
||||||
|
|
||||||
|
// CHECK-ERRORS: error: invalid hexadecimal number
|
||||||
|
.long 80+0xzz
|
||||||
|
Loading…
x
Reference in New Issue
Block a user