summaryrefslogtreecommitdiffstats
path: root/mlir/test/IR/invalid-affinemap.mlir
blob: a538568f5d1a9896762842bb60bbcb7fc07a11f4 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// RUN: mlir-opt %s -split-input-file -verify-diagnostics

// Check different error cases.
// -----
#hello_world = (i, j) -> ((), j) // expected-error {{no expression inside parentheses}}

// -----
#hello_world = (i, j) -> (->, j) // expected-error {{expected affine expression}}

// -----
#hello_world = (i, j) -> (:) // expected-error {{expected affine expression}}

// -----
#hello_world = (i, j) -> (, j) // expected-error {{expected affine expression}}

// -----
#hello_world (i, j) [s0] -> (i, j) // expected-error {{expected '=' in attribute alias definition}}

// -----
#hello_world = (i, j) [s0] -> (2*i*, 3*j*i*2 + 5) // expected-error {{missing right operand of binary op}}

// -----
#hello_world = (i, j) [s0] -> (i+, i+j+2 + 5) // expected-error {{missing right operand of binary op}}

// -----
#hello_world = (i, j) [s0] -> ((s0 + i, j) // expected-error {{expected ')'}}

// -----
#hello_world = (i, j) [s0] -> (((s0 + (i + j) + 5), j) // expected-error {{expected ')'}}

// -----
#hello_world = (i, j) [s0] -> i + s0, j) // expected-error {{expected '(' at start of affine map range}}

// -----
#hello_world = (i, j) [s0] -> (x) // expected-error {{use of undeclared identifier}}

// -----
#hello_world = (i, j, i) [s0] -> (i) // expected-error {{redefinition of identifier 'i'}}

// -----
#hello_world = (i, j) [s0, s1, s0] -> (i) // expected-error {{redefinition of identifier 's0'}}

// -----
#hello_world = (i, j) [i, s0] -> (j) // expected-error {{redefinition of identifier 'i'}}

// -----
#hello_world = (i, j) [s0, s1] -> () // expected-error {{expected list element}}

// -----
#hello_world = (i, j) [s0, s1] -> (+i, j) // expected-error {{missing left operand of binary op}}

// -----
#hello_world = (i, j) [s0, s1] -> (i, *j) // expected-error {{missing left operand of binary op}}

// -----
#hello_world = (i, j) [s0, s1] -> (floordiv i 2, j) // expected-error {{missing left operand of binary op}}

// -----
#hello_world = (i, j) [s0, s1] -> (ceildiv i 2, j) // expected-error {{missing left operand of binary op}}

// -----
#hello_world = (i, j) [s0, s1] -> (mod i 2, j) // expected-error {{missing left operand of binary op}}

// -----
#hello_world = (i, j) [s0, s1] -> (-(), j)
// expected-error@-1 {{no expression inside parentheses}}
// expected-error@-2 {{missing operand of negation}}

// -----
#hello_world = (i, j) [s0, s1] -> (i, *j+5) // expected-error {{missing left operand of binary op}}

// -----
#hello_world = (i, j) [s0, s1] -> (i, floordiv j+5) // expected-error {{missing left operand of binary op}}

// -----
#hello_world = (i, j) [s0, s1] -> (i, ceildiv j+5) // expected-error {{missing left operand of binary op}}

// -----
#hello_world = (i, j) [s0, s1] -> (i, mod j+5) // expected-error {{missing left operand of binary op}}

// -----
#hello_world = (i, j) [s0, s1] -> (i*j, j) // expected-error {{non-affine expression: at least one of the multiply operands has to be either a constant or symbolic}}

// -----
#hello_world = (i, j) [s0, s1] -> (i, j + j ceildiv 128 mod 16 * i - 4) // expected-error {{non-affine expression: at least one of the multiply operands has to be either a constant or symbolic}}

// -----
#hello_world = (i, j) [s0, s1] -> (i, j floordiv i) // expected-error {{non-affine expression: right operand of floordiv has to be either a constant or symbolic}}

// -----
#hello_world = (i, j) [s0, s1] -> (i, i*2 ceildiv j*5) // expected-error {{non-affine expression: right operand of ceildiv has to be either a constant or symbolic}}

// -----
#hello_world = (i, j) [s0, s1] -> (i, i mod (2+i)) // expected-error {{non-affine expression: right operand of mod has to be either a constant or symbolic}}

// -----
#hello_world = (i, j) [s0, s1] -> (-1*i j, j) // expected-error {{expected ',' or ')'}}

// -----
#hello_world = (i, j) -> (i, 3*d0 + ) // expected-error {{use of undeclared identifier}}

// TODO(bondhugula): Add more tests; coverage of error messages emitted not complete

// -----
#ABC = (i,j) -> (i+j)
#ABC = (i,j) -> (i+j)  // expected-error {{redefinition of attribute alias id 'ABC'}}
OpenPOWER on IntegriCloud