[llvm-readobj] - Simplify stack-sizes.test test case.
[llvm-complete.git] / test / MC / ARM / invalid-instructions-spellcheck.s
blobca118cff6ddf2ac2956b015e61021319cde93c8b
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:
8 r1, r2, r3
10 @ CHECK: error: unexpected token in operand
11 @ CHECK-NEXT: r1, r2, r3
12 @ CHECK-NEXT: ^
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
21 @ CHECK-NEXT: ^
23 @ Check that we get one suggestion: 'pushh' is 1 edit away, i.e. an deletion.
25 pushh r1, r2, r3
27 @CHECK: error: invalid instruction, did you mean: push?
28 @CHECK-NEXT: pushh r1, r2, r3
29 @CHECK-NEXT: ^
31 adXd 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
38 @ CHECK-NEXT: ^
40 @ Check edit distance 1 and 2, just insertions:
42 ad r1, r2, r3
44 @ CHECK: error: invalid instruction, did you mean: adc, add, adr, and, qadd?
45 @ CHECK-NEXT: ad r1, r2, r3
46 @ CHECK-NEXT: ^
48 @ Check an instruction that is 2 edits away, and also has a lot of candidates:
50 ldre r1, r2, r3
52 @ CHECK: error: invalid instruction, did you mean: ldr, ldrb, ldrd, ldrex, ldrexb, ldrexd, ldrexh, ldrh, ldrt?
53 @ CHECK-NEXT: ldre r1, r2, r3
54 @ CHECK-NEXT: ^
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.
60 fadd r1, r2, r3
62 @ CHECK-THUMB: error: invalid instruction, did you mean: add?
63 @ CHECK-THUMB: fadd r1, r2, r3
64 @ CHECK-THUMB: ^
66 @ CHECK: error: invalid instruction, did you mean: add, qadd?
67 @ CHECK-NEXT: fadd r1, r2, r3
68 @ CHECK-NEXT: ^