xref: /llvm-project/llvm/test/MC/SystemZ/asm-match.s (revision 4f7ff6bb38c8952a24b5cbae07031d78e359e573)
1// REQUIRES: asserts
2// RUN: llvm-mc -triple s390x-linux-gnu -debug-only=asm-matcher %s 2>&1 | FileCheck %s
3//
4// Check that debug output prints the operands correctly.
5
6// CHECK: AsmMatcher: found 1 encodings with mnemonic 'sllg'
7// CHECK: Trying to match opcode SLLG
8// CHECK: Matching formal operand class MCK_GR64 against actual operand at index 1 (Reg:r3): match success using generic matcher
9// CHECK: Matching formal operand class MCK_GR64 against actual operand at index 2 (Reg:r0): match success using generic matcher
10// CHECK: Matching formal operand class MCK_BDAddr32Disp20 against actual operand at index 3 (Mem:3): match success using generic matcher
11// CHECK: Matching formal operand class InvalidMatchClass against actual operand at index 4: actual operand index out of range
12// CHECK: Opcode result: complete match, selecting this opcode
13// CHECK: AsmMatcher: found 1 encodings with mnemonic 'llill'
14// CHECK: Trying to match opcode LLILL
15// CHECK: Matching formal operand class MCK_GR64 against actual operand at index 1 (Reg:r0): match success using generic matcher
16// CHECK: Matching formal operand class MCK_U16Imm against actual operand at index 2 (Imm:0): match success using generic matcher
17// CHECK: Matching formal operand class InvalidMatchClass against actual operand at index 3: actual operand index out of range
18// CHECK: Opcode result: complete match, selecting this opcode
19// CHECK: AsmMatcher: found 1 encodings with mnemonic 'lgr'
20// CHECK: Trying to match opcode LGR
21// CHECK: Matching formal operand class MCK_GR64 against actual operand at index 1 (Reg:r1): match success using generic matcher
22// CHECK: Matching formal operand class MCK_GR64 against actual operand at index 2 (Reg:r0): match success using generic matcher
23// CHECK: Matching formal operand class InvalidMatchClass against actual operand at index 3: actual operand index out of range
24// CHECK: Opcode result: complete match, selecting this opcode
25// CHECK: AsmMatcher: found 1 encodings with mnemonic 'lg'
26// CHECK: Trying to match opcode LG
27// CHECK: Matching formal operand class MCK_GR64 against actual operand at index 1 (Reg:r1): match success using generic matcher
28// CHECK: Matching formal operand class MCK_BDXAddr64Disp20 against actual operand at index 2 (Mem:16(r2)): match success using generic matcher
29// CHECK: Matching formal operand class InvalidMatchClass against actual operand at index 3: actual operand index out of range
30// CHECK: Opcode result: complete match, selecting this opcode
31// CHECK: AsmMatcher: found 1 encodings with mnemonic 'lg'
32// CHECK: Trying to match opcode LG
33// CHECK: Matching formal operand class MCK_GR64 against actual operand at index 1 (Reg:r1): match success using generic matcher
34// CHECK: Matching formal operand class MCK_BDXAddr64Disp20 against actual operand at index 2 (Mem:16(r2,r3)): match success using generic matcher
35// CHECK: Matching formal operand class InvalidMatchClass against actual operand at index 3: actual operand index out of range
36// CHECK: Opcode result: complete match, selecting this opcode
37// CHECK: AsmMatcher: found 1 encodings with mnemonic 'stmg'
38// CHECK: Trying to match opcode STMG
39// CHECK: Matching formal operand class MCK_GR64 against actual operand at index 1 (Reg:r13): match success using generic matcher
40// CHECK: Matching formal operand class MCK_GR64 against actual operand at index 2 (Reg:r15): match success using generic matcher
41// CHECK: Matching formal operand class MCK_BDAddr64Disp20 against actual operand at index 3 (Mem:104(r15)): match success using generic matcher
42// CHECK: Matching formal operand class InvalidMatchClass against actual operand at index 4: actual operand index out of range
43// CHECK: Opcode result: complete match, selecting this opcode
44// CHECK: AsmMatcher: found 1 encodings with mnemonic 'mvc'
45// CHECK: Trying to match opcode MVC
46// CHECK: Matching formal operand class MCK_BDLAddr64Disp12Len8 against actual operand at index 1 (Mem:184(8,r15)): match success using generic matcher
47// CHECK: Matching formal operand class MCK_BDAddr64Disp12 against actual operand at index 2 (Mem:8(r2)): match success using generic matcher
48// CHECK: Matching formal operand class InvalidMatchClass against actual operand at index 3: actual operand index out of range
49// CHECK: Opcode result: complete match, selecting this opcode
50// CHECK: AsmMatcher: found 1 encodings with mnemonic 'mvck'
51// CHECK: Trying to match opcode MVCK
52// CHECK: Matching formal operand class MCK_BDRAddr64Disp12 against actual operand at index 1 (Mem:0(r0,r1)): match success using generic matcher
53// CHECK: Matching formal operand class MCK_BDAddr64Disp12 against actual operand at index 2 (Mem:4095(r15)): match success using generic matcher
54// CHECK: Matching formal operand class MCK_GR64 against actual operand at index 3 (Reg:r2): match success using generic matcher
55// CHECK: Matching formal operand class InvalidMatchClass against actual operand at index 4: actual operand index out of range
56// CHECK: Opcode result: complete match, selecting this opcode
57// CHECK: AsmMatcher: found 1 encodings with mnemonic 'j'
58// CHECK: Trying to match opcode J
59// CHECK: Matching formal operand class MCK_PCRel16 against actual operand at index 1 (Imm:.Ltmp0+2): match success using generic matcher
60// CHECK: Matching formal operand class InvalidMatchClass against actual operand at index 2: actual operand index out of range
61// CHECK: Opcode result: complete match, selecting this opcode
62// CHECK: AsmMatcher: found 1 encodings with mnemonic 'brasl'
63// CHECK: Trying to match opcode BRASL
64// CHECK: Matching formal operand class MCK_GR64 against actual operand at index 1 (Reg:r14): match success using generic matcher
65// CHECK: Matching formal operand class MCK_PCRelTLS32 against actual operand at index 2 (ImmTLS:fun): match success using generic matcher
66// CHECK: Matching formal operand class InvalidMatchClass against actual operand at index 3: actual operand index out of range
67// CHECK: Opcode result: complete match, selecting this opcode
68// CHECK: sllg	%r3, %r0, 3
69// CHECK: llill	%r0, 0
70// CHECK: lgr	%r1, %r0
71// CHECK: lg	%r1, 16(%r2)
72// CHECK: lg	%r1, 16(%r2,%r3)
73// CHECK: stmg	%r13, %r15, 104(%r15)
74// CHECK: mvc	184(8,%r15), 8(%r2)
75// CHECK: mvck	0(%r0,%r1), 4095(%r15), %r2
76// CHECK: .Ltmp0:
77// CHECK: j	.Ltmp0+2
78// CHECK: brasl	%r14, fun
79
80        sllg    %r3, %r0, 3
81        llill	%r0, 0
82        lgr	%r1, %r0
83        lg      %r1, 16(%r2)
84        lg      %r1, 16(%r2,%r3)
85        stmg    %r13, %r15, 104(%r15)
86        mvc     184(8,%r15), 8(%r2)
87        mvck    0(%r0,%r1), 4095(%r15), %r2
88.Ltmp0:
89        j	.Ltmp0+2
90        brasl   %r14, fun
91