1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/MC/AsmParser/dot-symbol-assignment-backwards.s
Oliver Stannard f0a90b93e6 [Assembler] Better error messages for .org directive
Currently, the error messages we emit for the .org directive when the
expression is not absolute or is out of range do not include the line
number of the directive, so it can be hard to track down the problem if
a file contains many .org directives.

This patch stores the source location in the MCOrgFragment, so that it
can be used for diagnostics emitted during layout.

Since layout is an iterative process, and the errors are detected during
each iteration, it would have been possible for errors to be reported
multiple times. To prevent this, I've made the assembler bail out after
each iteration if any errors have been reported. This will still allow
multiple unrelated errors to be reported in the common case where they
are all detected in the first round of layout.

Differential Revision: https://reviews.llvm.org/D27411

llvm-svn: 289643
2016-12-14 10:43:58 +00:00

13 lines
223 B
ArmAsm

# RUN: not llvm-mc -filetype=obj -triple i386-unknown-unknown %s 2> %t
# RUN: FileCheck -input-file %t %s
. = 0x10
.byte 1
. = . + 10
.byte 2
# CHECK: error: invalid .org offset '24' (at offset '28')
. = 0x18
.byte 3