[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / Mips / invalid-instructions-spellcheck.s
blob9f1fb2f6f1be2da14dc97bb3f42ed55fe9ef7def
1 # RUN: not llvm-mc -triple mips-unknown-linux-gnu -mcpu=mips32r2 \
2 # RUN: -mattr=+micromips %s 2>&1 \
3 # RUN: | FileCheck --check-prefixes=ALL,MMR2 %s
4 # RUN: not llvm-mc -triple mips-unknown-linux-gnu -mcpu=mips32r6 \
5 # RUN: -mattr=+micromips %s 2>&1 \
6 # RUN: | FileCheck --check-prefixes=ALL,MMR6 %s
7 # RUN: not llvm-mc -triple mips-unknown-linux-gnu -mcpu=mips32r6 %s 2>&1 \
8 # RUN: | FileCheck --check-prefixes=ALL,MIPS32R6 %s
10 # This tests the mnemonic spell checker.
12 # First check what happens when an instruction is omitted:
14 $2, $1, $25
16 # ALL: error: unknown instruction
17 # ALL-NEXT: $2, $1, $25
18 # ALL-NEXT: ^
20 # We don't want to see a suggestion here; the edit distance is too large to
21 # give sensible suggestions:
23 aaaaaaaaaaaaaaa $2, $1, $25
25 # ALL: error: unknown instruction
26 # ALL-NEXT: aaaaaaaaaaaaaaa $2, $1, $25
27 # ALL-NEXT: ^
29 # Check that we get one suggestion: 'addiuspi' is 1 edit away, i.e. an deletion.
31 addiuspi -16
33 # MMR2: error: unknown instruction, did you mean: addiusp?
34 # MMR6: error: unknown instruction, did you mean: addiusp?
35 # MIPS32R6: error: unknown instruction{{$}}
36 # ALL: addiuspi -16
37 # ALL-NEXT: ^
39 # Check edit distance 1 and 2, just insertions:
41 addru $9, $6, 17767
43 # MMR2: error: unknown instruction, did you mean: add, addiu, addu, maddu?
44 # MMR6: error: unknown instruction, did you mean: add, addiu, addu?
45 # MIPS32R6: error: unknown instruction, did you mean: add, addiu, addu?
46 # ALL: addru $9, $6, 17767
47 # ALL-NEXT: ^
49 # Check an instruction that is 2 edits away, and also has a lot of candidates:
51 culE.d $fcc7, $f24, $f18
53 # MMR2: error: unknown instruction, did you mean: c.le.d, c.ule.d?
54 # MMR6: error: unknown instruction{{$}}
55 # MIPS32R6: error: unknown instruction{{$}}
56 # ALL: culE.d $fcc7, $f24, $f18
57 # ALL-NEXT: ^
59 # Check that candidates list includes only instructions valid for target CPU.
61 swk $3, $4
63 # MMR2: error: unknown instruction, did you mean: sw, swl, swm, swp, swr, usw?
64 # MMR6: error: unknown instruction, did you mean: sw, swm, swp, usw?
65 # MIPS32R6: error: unknown instruction, did you mean: sw, usw?
66 # ALL: swk $3, $4
67 # ALL-NEXT: ^