summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/SystemZ/mverify-optypes.mir
blob: aebafd395623646fd2c6eb7222c9606c3cf13820 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# RUN: not llc -mtriple=s390x-linux-gnu -mcpu=z14 -run-pass=none -o - %s \
# RUN:  2>&1 | FileCheck %s
# REQUIRES: asserts
#
# Test that the machine verifier catches wrong operand types.

--- |
  define anyregcc i64 @fun() { ret i64 0  }
  @gsrc = global i16 2
...
---
name:            fun
alignment:       16
tracksRegLiveness: true
registers:
  - { id: 0, class: gr64bit }
frameInfo:
  maxAlignment:    1
machineFunctionInfo: {}
body:             |
  bb.0 (%ir-block.0):
    liveins: $r2l
    %0:gr64bit = LGHI $r2l
    %1:addr64bit = LLILL $r2l
    %2:addr64bit = LGFI $r2l
    %3:addr64bit = LGFI 0

    %3:addr64bit = AG %3, %1, 0, %2, implicit-def dead $cc
    %3:addr64bit = AG %3, %1, %0, %2, implicit-def dead $cc
    %3:addr64bit = AG %3, %1, 0, 2, implicit-def dead $cc

    %4:addr64bit = LARL @gsrc
    %4:addr64bit = LARL $r2l

    MVCLoop %4, 0, %3, 0, 1680, %0, implicit-def $cc
    MVCLoop %4, 0, %3, 0, %1, %0, implicit-def $cc

    BCR 0, 0, $r2d, implicit $cc
    BCR 0, $r2d, $r2d, implicit $cc
    Return implicit $r2d

...

# CHECK: *** Bad machine code: Expected a non-register operand. ***
# CHECK: - instruction: %0:gr64bit = LGHI $r2l
# CHECK: - operand 1:   $r2l

# CHECK: *** Bad machine code: Expected a non-register operand. ***
# CHECK: - instruction: %1:addr64bit = LLILL $r2l
# CHECK: - operand 1:   $r2l

# CHECK: *** Bad machine code: Expected a non-register operand. ***
# CHECK: - instruction: %2:addr64bit = LGFI $r2l
# CHECK: - operand 1:   $r2l

# CHECK: *** Bad machine code: Addressing mode operands corrupt! ***
# CHECK: - instruction: %3:addr64bit = AG %3:addr64bit(tied-def 0), %1:addr64bit, %0:gr64bit, %2:addr64bit, implicit-def dead $cc

# CHECK: *** Bad machine code: Addressing mode operands corrupt! ***
# CHECK: - instruction: %3:addr64bit = AG %3:addr64bit(tied-def 0), %1:addr64bit, 0, 2, implicit-def dead $cc

# CHECK: *** Bad machine code: Expected a non-register operand. ***
# CHECK: - instruction: %4:addr64bit = LARL $r2l
# CHECK: - operand 1:   $r2l

# CHECK: *** Bad machine code: Expected a non-register operand. ***
# CHECK: - instruction: MVCLoop %4:addr64bit, 0, %3:addr64bit, 0, %1:addr64bit, %0:gr64bit, implicit-def $cc
# CHECK: - operand 4:   %1:addr64bit

# CHECK: *** Bad machine code: Expected a non-register operand. ***
# CHECK: - instruction: BCR 0, $r2d, $r2d, implicit $cc
# CHECK: - operand 1:   $r2d
OpenPOWER on IntegriCloud