llvm/test/MC/ARM
James Molloy b36a459b2c Fix for pr24346: arm asm label calculation error in sub
Some ARM instructions encode 32-bit immediates as a 8-bit integer (0-255)
and a 4-bit rotation (0-30, even) in its least significant 12 bits. The
original fixup, FK_Data_4, patches the instruction by the value bit-to-bit,
regardless of the encoding. For example, assuming the label L1 and L2 are
0x0 and 0x104 respectively, the following instruction:

  add r0, r0, #(L2 - L1) ; expects 0x104, i.e., 260

would be assembled to the following, which adds 1 to r0, instead of 260:

  e2800104 add r0, r0, #4, 2 ; equivalently 1

The new fixup kind fixup_arm_mod_imm takes care of the encoding:

  e2800f41 add r0, r0, #260

Patch by Ting-Yuan Huang!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 09:40:47 +00:00
..
AlignedBundling
Windows [MC, COFF] Support link /incremental conditionally 2015-12-21 22:09:27 +00:00
2010-11-30-reloc-movt.s
2013-03-18-Br-to-label-named-like-reg.s
align_arm_2_thumb.s
align_thumb_2_arm.s
arm11-hint-instr.s [ARM] Split out ARMv8-A semaphores and atomics and ARMv7 clrex as separate features 2016-01-15 10:23:46 +00:00
arm_addrmode2.s
arm_addrmode3.s
arm_fixups.s Fix for pr24346: arm asm label calculation error in sub 2016-04-01 09:40:47 +00:00
arm_instructions.s
arm-aliases.s
arm-arithmetic-aliases.s
arm-elf-relocation-diagnostics.s [Assembler] Make fatal assembler errors non-fatal 2015-11-17 10:00:43 +00:00
arm-elf-relocations.s
arm-elf-symver.s Omit unused section symbols from the symbol table. 2015-06-04 15:33:30 +00:00
arm-it-block.s
arm-ldrd.s
arm-load-store-multiple-deprecated.s
arm-memory-instructions.s
arm-qualifier-diagnostics.s
arm-shift-encoding.s
arm-thumb-cpus-default.s
arm-thumb-cpus.s
arm-thumb-trustzone.s Recognize that ARM1176JZ[F]-S support TrustZone 2015-10-29 13:56:19 +00:00
arm-trustzone.s Recognize that ARM1176JZ[F]-S support TrustZone 2015-10-29 13:56:19 +00:00
basic-arm-instructions-v8.1a.s Fix a bunch of trivial cases of 'CHECK[^:]*$' in the tests. NFCI 2015-08-10 19:01:27 +00:00
basic-arm-instructions-v8.s
basic-arm-instructions.s [ARM] Operands for PKHTB alias should be swapped 2016-01-18 11:56:35 +00:00
basic-thumb2-instructions-v8.s [ARM] Allow SP in rGPR, starting from ARMv8 2015-10-28 13:58:36 +00:00
basic-thumb2-instructions.s [ARM] Operands for PKHTB alias should be swapped 2016-01-18 11:56:35 +00:00
basic-thumb-instructions.s
big-endian-arm-fixup.s
big-endian-thumb2-fixup.s ARM: diagnose invalid local fixups on Thumb1 2015-10-02 18:07:18 +00:00
big-endian-thumb-fixup.s
bkpt.s
bracket-darwin.s
bracket-exprs.s
cmp-immediate-fixup2.s
cmp-immediate-fixup-error2.s
cmp-immediate-fixup-error.s
cmp-immediate-fixup.s
coff-debugging-secrel.ll testcase gardening: update the emissionKind enum to the new syntax. (NFC) 2016-04-01 00:16:49 +00:00
coff-file.s
coff-function-type-info.ll
coff-relocations.s
comment.s
complex-operands.s
coproc-diag.s
cps.s
cpu-test.s
crc32-thumb.s
crc32.s
cxx-global-constructor.ll
d16.s
data-in-code.ll [ARM] Generate ABI_optimization_goals build attribute, as described in the ARM ARM. 2015-12-07 14:22:39 +00:00
deprecated-v8.s
diagnostics-noneon.s
diagnostics.s [ARM] Allow SP in rGPR, starting from ARMv8 2015-10-28 13:58:36 +00:00
directive-align.s Followup to 258750; update all MC tests to use .p2align . 2016-01-26 00:27:59 +00:00
directive-arch_extension-crc.s
directive-arch_extension-crypto.s
directive-arch_extension-fp.s
directive-arch_extension-idiv.s
directive-arch_extension-mode-switch.s
directive-arch_extension-mp.s
directive-arch_extension-sec.s [ARM] Support for ARMv6-Z / ARMv6-ZK missing 2015-09-30 17:25:52 +00:00
directive-arch_extension-simd.s
directive-arch_extension-toggle.s
directive-arch-armv2.s ARMTargetParser: Normalising build attributes 2015-05-27 18:15:37 +00:00
directive-arch-armv2a.s ARMTargetParser: Normalising build attributes 2015-05-27 18:15:37 +00:00
directive-arch-armv3.s ARMTargetParser: Normalising build attributes 2015-05-27 18:15:37 +00:00
directive-arch-armv3m.s ARMTargetParser: Normalising build attributes 2015-05-27 18:15:37 +00:00
directive-arch-armv4.s
directive-arch-armv4t.s
directive-arch-armv5.s
directive-arch-armv5t.s
directive-arch-armv5te.s
directive-arch-armv6-m.s
directive-arch-armv6.s
directive-arch-armv6k.s
directive-arch-armv6t2.s
directive-arch-armv6z.s Handle ARMv6KZ naming 2015-11-16 14:05:32 +00:00
directive-arch-armv7-a.s
directive-arch-armv7-m.s
directive-arch-armv7-r.s
directive-arch-armv7.s
directive-arch-armv7a.s
directive-arch-armv7m.s
directive-arch-armv7r.s
directive-arch-armv8-a.s
directive-arch-armv8.2-a.s [ARM] Add ARMv8.2-A to TargetParser 2015-12-01 10:33:56 +00:00
directive-arch-armv8a.s
directive-arch-iwmmxt2.s
directive-arch-iwmmxt.s
directive-arch-semantic-action.s Actually switch the arch when we see .arch. PR21695 2015-10-02 18:25:25 +00:00
directive-cpu.s
directive-eabi_attribute-diagnostics.s
directive-eabi_attribute-overwrite.s
directive-eabi_attribute.s [ARM] Add DSP build attribute and extension targeting 2016-01-25 11:26:11 +00:00
directive-even.s
directive-fpu-diagnostics.s
directive-fpu-instrs.s
directive-fpu-multiple.s [ARM]: Extend -mfpu options for half-precision and vfpv3xd 2015-06-29 09:32:29 +00:00
directive-fpu-softvfp.s
directive-fpu.s
directive-literals.s
directive-object_arch-2.s
directive-object_arch-3.s
directive-object_arch-diagnostics.s
directive-object_arch.s
directive-thumb_func.s
directive-tlsdescseq-diagnostics.s
directive-tlsdescseq.s
directive-type-diagnostics.s Reworking the test part of r241149 2015-07-02 16:53:23 +00:00
directive-unsupported.s
directive-word-diagnostics.s
dot-req-case-insensitive.s
dot-req.s
dwarf-asm-multiple-sections-dwarf-2.s Form reform for MCDwarf. 2015-12-23 01:57:31 +00:00
dwarf-asm-multiple-sections.s Form reform for MCDwarf. 2015-12-23 01:57:31 +00:00
dwarf-asm-no-code.s
dwarf-asm-nonstandard-section.s Form reform for MCDwarf. 2015-12-23 01:57:31 +00:00
dwarf-asm-single-section.s Form reform for MCDwarf. 2015-12-23 01:57:31 +00:00
dwarf-cfi-initial-state.s
eh-compact-pr0.s Avoid explicit relocation sorting most of the time. 2015-12-17 16:22:06 +00:00
eh-compact-pr1.s Avoid explicit relocation sorting most of the time. 2015-12-17 16:22:06 +00:00
eh-directive-cantunwind-diagnostics.s
eh-directive-cantunwind.s
eh-directive-fnend-diagnostics.s
eh-directive-fnstart-diagnostics.s
eh-directive-handlerdata.s Avoid explicit relocation sorting most of the time. 2015-12-17 16:22:06 +00:00
eh-directive-integrated-test.s
eh-directive-movsp-diagnostics.s
eh-directive-movsp.s
eh-directive-multiple-offsets.s
eh-directive-pad-diagnostics.s
eh-directive-pad.s
eh-directive-personality-diagnostics.s
eh-directive-personality.s
eh-directive-personalityindex-diagnostics.s
eh-directive-personalityindex.s Avoid explicit relocation sorting most of the time. 2015-12-17 16:22:06 +00:00
eh-directive-save-diagnostics.s
eh-directive-save.s
eh-directive-section-comdat.s Don't create empty sections just to look like gas. 2015-11-03 20:02:22 +00:00
eh-directive-section-multiple-func.s Don't create empty sections just to look like gas. 2015-11-03 20:02:22 +00:00
eh-directive-section.s Don't create empty sections just to look like gas. 2015-11-03 20:02:22 +00:00
eh-directive-setfp-diagnostics.s
eh-directive-setfp.s
eh-directive-text-section-multiple-func.s
eh-directive-text-section.s Avoid explicit relocation sorting most of the time. 2015-12-17 16:22:06 +00:00
eh-directive-unwind_raw-diagnostics.s
eh-directive-unwind_raw.s
eh-directive-vsave-diagnostics.s
eh-directive-vsave.s
eh-link.s Don't create empty sections just to look like gas. 2015-11-03 20:02:22 +00:00
elf-eflags-eabi.s
elf-jump24-fixup.s
elf-movt.s No need to check the raw relocation bytes if checking the parsed dump. 2015-06-04 15:21:17 +00:00
elf-reloc-01.s Convert a few tests to use llvm-mc. 2015-06-18 13:39:07 +00:00
elf-reloc-02.s Revert r240302 ("Bring r240130 back."). 2015-06-23 11:31:32 +00:00
elf-reloc-03.s Convert a few tests to use llvm-mc. 2015-06-18 13:39:07 +00:00
elf-reloc-condcall.s
elf-thumbfunc-reloc2.s Convert a few tests to use llvm-mc. 2015-06-18 13:39:07 +00:00
elf-thumbfunc-reloc.s
elf-thumbfunc.s
error-location-ldr-pseudo.s [ARM,AArch64] Store source location of asm constant pool entries 2015-11-16 16:25:47 +00:00
error-location.s Accept subtractions involving a weak symbol. 2016-01-20 18:57:48 +00:00
fconst.s
fixup-cpu-mode.s
fp-armv8.s
fp-const-errors.s
full_line_comment.s
fullfp16-neg.s [ARM] Add ARMv8.2-A FP16 scalar instructions 2016-01-25 10:26:26 +00:00
fullfp16-neon-neg.s [ARM] Add ARMv8.2-A FP16 vector instructions 2015-12-16 12:37:39 +00:00
fullfp16-neon.s [ARM] Add ARMv8.2-A FP16 vector instructions 2015-12-16 12:37:39 +00:00
fullfp16.s [ARM] Add ARMv8.2-A FP16 scalar instructions 2016-01-25 10:26:26 +00:00
gas-compl-copr-reg.s Fix several accidental DOS line endings in source files 2016-01-03 17:22:03 +00:00
hilo-16bit-relocations.s
idiv.s
inst-arm-suffixes.s
inst-constant-required.s
inst-directive-emit.s Followup to 258750; update all MC tests to use .p2align . 2016-01-26 00:27:59 +00:00
inst-directive.s
inst-overflow.s
inst-thumb-overflow-2.s
inst-thumb-overflow.s
inst-thumb-suffixes.s
invalid-barrier.s
invalid-crc32.s
invalid-fp-armv8.s
invalid-hint-arm.s
invalid-hint-thumb.s
invalid-idiv.s
invalid-neon-v8.s
invalid-vector-index.s
ldr-pseudo-darwin.s Followup to 258750; update all MC tests to use .p2align . 2016-01-26 00:27:59 +00:00
ldr-pseudo-obj-errors.s
ldr-pseudo-parse-errors.s
ldr-pseudo.s Followup to 258750; update all MC tests to use .p2align . 2016-01-26 00:27:59 +00:00
ldrd-strd-gnu-arm-bad-imm.s
ldrd-strd-gnu-arm.s
ldrd-strd-gnu-sp.s
ldrd-strd-gnu-thumb-bad-regs.s
ldrd-strd-gnu-thumb.s
lit.local.cfg
load-store-acquire-release-v8-thumb.s [ARM] Split out ARMv8-A semaphores and atomics and ARMv7 clrex as separate features 2016-01-15 10:23:46 +00:00
load-store-acquire-release-v8.s [ARM] Split out ARMv8-A semaphores and atomics and ARMv7 clrex as separate features 2016-01-15 10:23:46 +00:00
ltorg-darwin.s Followup to 258750; update all MC tests to use .p2align . 2016-01-26 00:27:59 +00:00
ltorg.s Followup to 258750; update all MC tests to use .p2align . 2016-01-26 00:27:59 +00:00
macho-movwt.s ARM: fix handling of movw/movt relocations with addend. 2016-02-23 20:20:23 +00:00
macho-relocs-with-addend.s
mapping-within-section.s
mode-switch.s
modified-immediate-fixup-error.s Fix for pr24346: arm asm label calculation error in sub 2016-04-01 09:40:47 +00:00
modified-immediate-fixup.s Fix for pr24346: arm asm label calculation error in sub 2016-04-01 09:40:47 +00:00
move-banked-regs.s
mul-v4.s
multi-section-mapping.s
neon-abs-encoding.s
neon-absdiff-encoding.s
neon-add-encoding.s
neon-bitcount-encoding.s
neon-bitwise-encoding.s
neon-cmp-encoding.s
neon-convert-encoding.s
neon-crypto.s
neon-dup-encoding.s
neon-minmax-encoding.s
neon-mov-encoding.s
neon-mov-vfp.s
neon-mul-accum-encoding.s
neon-mul-encoding.s
neon-neg-encoding.s
neon-pairwise-encoding.s
neon-reciprocal-encoding.s
neon-reverse-encoding.s
neon-satshift-encoding.s
neon-shift-encoding.s
neon-shiftaccum-encoding.s
neon-shuffle-encoding.s
neon-sub-encoding.s
neon-table-encoding.s
neon-v8.s
neon-vcvt-fp16.s [ARM] Flag vcvt{t,b} with an f16 type specifier as part of the FP16 extension 2015-12-07 10:54:36 +00:00
neon-vld-encoding.s
neon-vld-vst-align.s
neon-vst-encoding.s
neon-vswp.s
neont2-abs-encoding.s
neont2-absdiff-encoding.s
neont2-add-encoding.s
neont2-bitcount-encoding.s
neont2-bitwise-encoding.s
neont2-cmp-encoding.s
neont2-convert-encoding.s
neont2-dup-encoding.s
neont2-minmax-encoding.s
neont2-mov-encoding.s
neont2-mul-accum-encoding.s
neont2-mul-encoding.s
neont2-neg-encoding.s
neont2-pairwise-encoding.s
neont2-reciprocal-encoding.s
neont2-reverse-encoding.s
neont2-satshift-encoding.s
neont2-shift-encoding.s
neont2-shiftaccum-encoding.s
neont2-shuffle-encoding.s
neont2-sub-encoding.s
neont2-table-encoding.s
neont2-vld-encoding.s
neont2-vst-encoding.s
not-armv4.s
obsolete-v8.s
pool.s Followup to 258750; update all MC tests to use .p2align . 2016-01-26 00:27:59 +00:00
pr11877.s
pr22395-2.s
pr22395.s
relocated-mapping.s
simple-fp-encoding.s
single-precision-fp.s
symbol-variants-errors.s
symbol-variants.s ARM: Support relative references using the PREL31 symbol variant. 2016-03-10 19:30:18 +00:00
target-expressions.s
thumb1-relax-8m-baseline.s [ARM] Add B.W and CBZ instructions to ARMv8-M Baseline 2016-01-15 10:26:17 +00:00
thumb1-relax-adr.s
thumb1-relax-bcc.s
thumb1-relax-br.s
thumb1-relax-ldrlit.s
thumb1-relax.s [Assembler] Make fatal assembler errors non-fatal 2015-11-17 10:00:43 +00:00
thumb2-b.w-encodingT4.s
thumb2-branches.s
thumb2-bxj-v8.s
thumb2-bxj.s
thumb2-cbn-to-next-inst.s
thumb2-diagnostics.s ARM: disallow pc as a base register in Thumb2 memory ops. 2016-02-25 16:54:52 +00:00
thumb2-dsp-diag.s
thumb2-exception-return-mclass.s
thumb2-ldrb-ldrh.s
thumb2-ldrd.s
thumb2-ldrexd-strexd.s
thumb2-mclass.s
thumb2-narrow-dp.ll [ARM] Handle commutativity when converting to tADDhirr in Thumb2 2015-07-13 15:31:48 +00:00
thumb2-pldw.s
thumb2-strd.s
thumb2be-b.w-encoding.s
thumb2be-beq.w-encoding.s
thumb2be-movt-encoding.s
thumb2be-movw-encoding.s
thumb_rewrites.s [ARM] Handle commutativity when converting to tADDhirr in Thumb2 2015-07-13 15:31:48 +00:00
thumb_set-diagnostics.s Change .thumb_set to have the same error checks as .set. 2015-06-22 19:35:57 +00:00
thumb_set.s Change .thumb_set to have the same error checks as .set. 2015-06-22 19:35:57 +00:00
thumb-branches.s Go back to producing relocations for out of range symbols. 2015-11-05 01:10:15 +00:00
thumb-diagnostics.s
thumb-far-jump.s
thumb-fp-armv8.s
thumb-hints.s
thumb-invalid-crypto.txt
thumb-load-store-multiple.s
thumb-movwt-reloc.s [ARM] Add MOVW/MOVT instructions to ARMv8-M Baseline/Mainline 2016-01-15 10:25:14 +00:00
thumb-neon-crypto.s
thumb-neon-v8.s
thumb-not-mclass.s
thumb-only-conditionals.s
thumb-shift-encoding.s [ARM] Allow SP in rGPR, starting from ARMv8 2015-10-28 13:58:36 +00:00
thumb-st_other.s
thumb-types.s
thumb.s
thumbv7em.s
thumbv7m.s
thumbv8m.s [ARM] Add DSP build attribute and extension targeting 2016-01-25 11:26:11 +00:00
twice.ll [ARM] Fix several state persistence bugs 2016-01-12 13:38:15 +00:00
udf-arm-diagnostics.s
udf-arm.s
udf-thumb-2-diagnostics.s
udf-thumb-2.s
udf-thumb-diagnostics.s
udf-thumb.s
unwind-stack-diagnostics.s
v7k-dsp.s WatchOS: update default CPU for triple after t2dsp -> dsp rename 2015-11-02 18:21:07 +00:00
v8_IT_manual.s
variant-diagnostics.s
vfp4.s
vfp-aliases-diagnostics.s
vfp-aliases.s
virtexts-arm.s
virtexts-thumb.s
vmov-vmvn-byte-replicate.s
vmov-vmvn-illegal-cases.s
vorr-vbic-illegal-cases.s
vpush-vpop.s