1 @ RUN
: not llvm-mc
-triple
=arm
-show-encoding
< %s
2>&1 | FileCheck
%s
2 @ RUN
: not llvm-mc
-triple
=thumb
-show-encoding
< %s
2>&1 | FileCheck
%s
--check-prefix
=CHECK-THUMB
4 @ This tests the mnemonic spell checker.
6 @ First check what happens when an instruction is omitted
:
10 @ CHECK
: error
: unexpected token in operand
11 @ CHECK-NEXT
: r1, r2, r3
14 @ We don
't want to see a suggestion here; the edit distance is too large to
15 @ give sensible suggestions:
17 aaaaaaaaaaaaaaa r1, r2, r3
19 @ CHECK: error: invalid instruction
20 @ CHECK-NEXT: aaaaaaaaaaaaaaa r1, r2, r3
23 @ Check that we get one suggestion: 'pushh
' is 1 edit away, i.e. an deletion.
27 @CHECK: error: invalid instruction, did you mean: push?
28 @CHECK-NEXT: pushh r1, r2, r3
33 @ Check edit distance 1 and 2: 'add' has edit distance of 1 (a deletion),
34 @ and 'qadd
' a distance of 2 (a deletion and an insertion)
36 @ CHECK: error: invalid instruction, did you mean: add, qadd?
37 @ CHECK-NEXT: adXd r1, r2, r3
40 @ Check edit distance 1 and 2, just insertions:
44 @ CHECK: error: invalid instruction, did you mean: adc, add, adr, and, qadd?
45 @ CHECK-NEXT: ad r1, r2, r3
48 @ Check an instruction that is 2 edits away, and also has a lot of candidates:
52 @ CHECK: error: invalid instruction, did you mean: ldr, ldrb, ldrd, ldrex, ldrexb, ldrexd, ldrexh, ldrh, ldrt?
53 @ CHECK-NEXT: ldre r1, r2, r3
56 @ Here it is checked that we don't suggest instructions that are
not supported.
57 @ For example
, in Thumb mode we don
't want to see suggestions 'faddd
' of 'qadd
'
58 @ because they are not supported.
62 @ CHECK-THUMB: error: invalid instruction, did you mean: add?
63 @ CHECK-THUMB: fadd r1, r2, r3
66 @ CHECK: error: invalid instruction, did you mean: add, qadd?
67 @ CHECK-NEXT: fadd r1, r2, r3