1# RUN: not llvm-mc -triple=systemz -mcpu=z13 -show-encoding < %s 2>&1 | FileCheck %s 2# RUN: not llvm-mc -triple=systemz -mcpu=zEC12 -show-encoding < %s 2>&1 | FileCheck %s --check-prefix=CHECK-ZEC12 3 4# This tests the mnemonic spell checker. 5 6# First check what happens when an instruction is omitted: 7 8 %r1, %r2, %r3 9 10# CHECK: error: unexpected token at start of statement 11# CHECK-NEXT: %r1, %r2, %r3 12# CHECK-NEXT: ^ 13 14# We don't want to see a suggestion here; the edit distance is too large to 15# give sensible suggestions: 16 17 aaaaaaaaaaaaaaa %r1, %r2, %r3 18 19# CHECK: error: invalid instruction 20# CHECK-NEXT: aaaaaaaaaaaaaaa %r1, %r2, %r3 21# CHECK-NEXT: ^ 22 23# Check that we get one suggestion: 'cpdt' is 1 edit away, i.e. an deletion. 24 25 cpdtX %r1, 0(4, %r15), 0 26 27#CHECK: error: invalid instruction, did you mean: cpdt 28#CHECK-NEXT: cpdtX %r1, 0(4, %r15), 0 29#CHECK-NEXT: ^ 30 31# Check edit distance 1 and 2 32 33 ltTr %r1, %r2 34 35# CHECK: error: invalid instruction, did you mean: lr, lt, ltdr, ltdtr, lter, ltgr, ltr, ltxr, ltxtr, tr, trtr? 36# CHECK-NEXT: ltTr %r1, %r2 37# CHECK-NEXT: ^ 38 39# Check edit distance 1 and 2, just insertions: 40 41 begin 0, 65292 42 43# CHECK: error: invalid instruction, did you mean: tbegin, tbeginc? 44# CHECK-NEXT: begin 0, 65292 45# CHECK-NEXT: ^ 46 47# Check an instruction that is 2 edits away, and also has a lot of candidates: 48 49 adt %r1, 244(%r15) 50 51# CHECK: error: invalid instruction, did you mean: a, ad, adb, adr, adtr, adtra, d, lat, mad, qadtr? 52# CHECK-NEXT: adt %r1, 244(%r15) 53# CHECK-NEXT: ^ 54 55# Here it is checked that we don't suggest instructions that are not supported. 56# For example, in pre-z13 mode we don't want to see suggestions for vector instructions. 57 58 vlvggp %v1, %r2, %r3 59 60# CHECK-ZEC12: error: invalid instruction 61# CHECK-ZEC12: vlvggp 62# CHECK-ZEC12: ^ 63 64# CHECK: error: invalid instruction, did you mean: vlvg, vlvgg, vlvgp? 65# CHECK-NEXT: vlvggp %v1, %r2, %r3 66# CHECK-NEXT: ^ 67