brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · ca118cf Raw
69 lines · plain
1@ RUN: not llvm-mc -triple=arm -show-encoding < %s 2>&1 | FileCheck %s2@ RUN: not llvm-mc -triple=thumb -show-encoding < %s 2>&1 | FileCheck %s --check-prefix=CHECK-THUMB3 4@ This tests the mnemonic spell checker.5 6@ First check what happens when an instruction is omitted:7 8  r1, r2, r39 10@ CHECK:      error: unexpected token in operand11@ CHECK-NEXT: r1, r2, r312@ CHECK-NEXT:   ^13 14@ We don't want to see a suggestion here; the edit distance is too large to15@ give sensible suggestions:16 17  aaaaaaaaaaaaaaa r1, r2, r318 19@ CHECK:      error: invalid instruction20@ CHECK-NEXT: aaaaaaaaaaaaaaa r1, r2, r321@ CHECK-NEXT: ^22 23@ Check that we get one suggestion: 'pushh' is 1 edit away, i.e. an deletion.24 25  pushh r1, r2, r326 27@CHECK:      error: invalid instruction, did you mean: push?28@CHECK-NEXT: pushh r1, r2, r329@CHECK-NEXT: ^30 31  adXd r1, r2, r332 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)35 36@ CHECK:      error: invalid instruction, did you mean: add, qadd?37@ CHECK-NEXT: adXd r1, r2, r338@ CHECK-NEXT: ^39 40@ Check edit distance 1 and 2, just insertions:41 42  ad r1, r2, r343 44@ CHECK:      error: invalid instruction, did you mean: adc, add, adr, and, qadd?45@ CHECK-NEXT: ad r1, r2, r346@ CHECK-NEXT: ^47 48@ Check an instruction that is 2 edits away, and also has a lot of candidates:49 50  ldre r1, r2, r351 52@ CHECK:      error: invalid instruction, did you mean: ldr, ldrb, ldrd, ldrex, ldrexb, ldrexd, ldrexh, ldrh, ldrt?53@ CHECK-NEXT: ldre r1, r2, r354@ CHECK-NEXT: ^55 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.59 60  fadd r1, r2, r361 62@ CHECK-THUMB: error: invalid instruction, did you mean: add?63@ CHECK-THUMB: fadd r1, r2, r364@ CHECK-THUMB: ^65 66@ CHECK:      error: invalid instruction, did you mean: add, qadd?67@ CHECK-NEXT: fadd r1, r2, r368@ CHECK-NEXT: ^69