invalid-module-op.mlir
926 Bytes
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
// RUN: mlir-opt %s -split-input-file -verify-diagnostics
// -----
func @module_op() {
// expected-error@+1 {{Operations with a 'SymbolTable' must have exactly one block}}
module {
^bb1:
"module_terminator"() : () -> ()
^bb2:
"module_terminator"() : () -> ()
}
return
}
// -----
func @module_op() {
// expected-error@+1 {{region should have no arguments}}
module {
^bb1(%arg: i32):
"module_terminator"() : () -> ()
}
return
}
// -----
func @module_op() {
// expected-error@below {{expects regions to end with 'module_terminator'}}
// expected-note@below {{the absence of terminator implies 'module_terminator'}}
module {
return
}
return
}
// -----
func @module_op() {
// expected-error@+1 {{expects parent op 'module'}}
"module_terminator"() : () -> ()
}
// -----
// expected-error@+1 {{can only contain dialect-specific attributes}}
module attributes {attr} {
}