forked from OSchip/llvm-project
[MC][PowerPC] Replace MCContext::reportFatalError calls with reportError
User errors should use reportError. reportError allows us to continue parsing the file and collect more diagnostics. While here, make the diagnostic follow convention, merge tests, and test line/column numbers.
This commit is contained in:
parent
122cab9b05
commit
1ae1dd16cf
|
@ -271,14 +271,14 @@ private:
|
|||
MCAssembler &MCA = getStreamer().getAssembler();
|
||||
int64_t Offset;
|
||||
if (!LocalOffset->evaluateAsAbsolute(Offset, MCA))
|
||||
MCA.getContext().reportFatalError(
|
||||
LocalOffset->getLoc(), ".localentry expression must be absolute.");
|
||||
MCA.getContext().reportError(LocalOffset->getLoc(),
|
||||
".localentry expression must be absolute");
|
||||
|
||||
switch (Offset) {
|
||||
default:
|
||||
MCA.getContext().reportFatalError(
|
||||
LocalOffset->getLoc(),
|
||||
".localentry expression is not a valid power of 2.");
|
||||
MCA.getContext().reportError(
|
||||
LocalOffset->getLoc(), ".localentry expression must be a power of 2");
|
||||
return 0;
|
||||
case 0:
|
||||
return 0;
|
||||
case 1:
|
||||
|
|
|
@ -4,8 +4,12 @@
|
|||
# RUN: not llvm-mc -triple powerpc64le-unknown-unknown -filetype=obj < %s 2> %t
|
||||
# RUN: FileCheck < %t %s
|
||||
|
||||
.globl remote_sym
|
||||
sym:
|
||||
|
||||
# CHECK: :0: error: .localentry expression must be a power of 2
|
||||
.localentry sym, 123
|
||||
|
||||
# CHECK: error: .localentry expression is not a valid power of 2.
|
||||
# CHECK: :[[#@LINE+1]]:19: error: .localentry expression must be absolute
|
||||
.localentry sym, remote_sym
|
||||
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
|
||||
# RUN: not llvm-mc -triple powerpc64-unknown-unknown -filetype=obj < %s 2> %t
|
||||
# RUN: FileCheck < %t %s
|
||||
# RUN: not llvm-mc -triple powerpc64le-unknown-unknown -filetype=obj < %s 2> %t
|
||||
# RUN: FileCheck < %t %s
|
||||
|
||||
.globl remote_sym
|
||||
sym:
|
||||
.localentry sym, remote_sym
|
||||
|
||||
# CHECK: error: .localentry expression must be absolute.
|
||||
|
Loading…
Reference in New Issue