1# RUN: not llvm-mc -triple powerpc-unknown-unknown < %s 2>&1 | FileCheck %s 2 3# This tests the mnemonic spell checker. 4 5# First check what happens when an instruction is omitted: 6 7%r1, %r2, %r3 8 9# CHECK: error: unexpected token at start of statement 10# CHECK-NEXT: %r1, %r2, %r3 11# CHECK-NEXT: ^ 12 13# We don't want to see a suggestion here; the edit distance is too large to 14# give sensible suggestions: 15 16aaaaaaaaaaaaaaa %r1, %r2, %r3 17 18# CHECK: error: invalid instruction 19# CHECK-NEXT: aaaaaaaaaaaaaaa %r1, %r2, %r3 20# CHECK-NEXT: ^ 21 22# Check that we get one suggestion: 'vmaxfpg' is 1 edit away, i.e. an deletion. 23 24vmaxfpg %r1, %r2 25 26# CHECK: error: invalid instruction, did you mean: vmaxfp? 27# CHECK-NEXT: vmaxfpg %r1, %r2 28# CHECK-NEXT: ^ 29 30# Check edit distance 1 and 2, just insertions: 31 32xsnmsubad %r1, %r2 33 34# CHECK: error: invalid instruction, did you mean: xsmsubadp, xsnmsubadp? 35# CHECK-NEXT: xsnmsubad %r1, %r2 36# CHECK-NEXT: ^ 37 38# Check an instruction that is 2 edits away, and also has a lot of candidates: 39 40adXd %r1, %r2, %r3 41 42# CHECK: error: invalid instruction, did you mean: add, addc, adde, addi, addo, fadd? 43# CHECK-NEXT: adXd %r1, %r2, %r3 44# CHECK-NEXT: ^ 45