diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2015-01-22 04:03:32 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2015-01-22 04:03:32 +0000 |
commit | 10ed0babd301570bbd23cce7b45b5985779e0572 (patch) | |
tree | c0b22652d7f884fea48ef878ac3ddb883bb6e435 /llvm/test | |
parent | 1b65dbc4772181dea314782d18717e5397ad2354 (diff) | |
download | bcm5719-llvm-10ed0babd301570bbd23cce7b45b5985779e0572.tar.gz bcm5719-llvm-10ed0babd301570bbd23cce7b45b5985779e0572.zip |
ARM: fail less catastrophically on invalid Windows input
Windows supports a restricted set of relocations (compared to ARM ELF). In some
cases, we may end up generating an unsupported relocation. This can occur with
bad input to the assembler in particular (the frontend should never generate
code that cannot be compiled). Generate an error rather than just aborting.
The change in the API is driven by the desire to provide a slightly more helpful
message for debugging purposes.
llvm-svn: 226779
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/MC/ARM/Windows/invalid-relocation.s | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/MC/ARM/Windows/invalid-relocation.s b/llvm/test/MC/ARM/Windows/invalid-relocation.s new file mode 100644 index 00000000000..4f4c59839a6 --- /dev/null +++ b/llvm/test/MC/ARM/Windows/invalid-relocation.s @@ -0,0 +1,14 @@ +# RUN: not llvm-mc -triple thumbv7-windows -filetype obj -o /dev/null 2>&1 %s \ +# RUN: | FileCheck %s + + .def invalid_relocation + .type 32 + .scl 2 + .endef + .global invalid_relocation + .thumb_func +invalid_relocation: + adr r0, invalid_relocation+1 + +# CHECK: LLVM ERROR: unsupported relocation type: fixup_t2_adr_pcrel_12 + |