1// RUN: mlir-opt %s -split-input-file -verify-diagnostics
2
3// -----
4
5func @module_op() {
6  // expected-error@+1 {{Operations with a 'SymbolTable' must have exactly one block}}
7  module {
8  ^bb1:
9    "module_terminator"() : () -> ()
10  ^bb2:
11    "module_terminator"() : () -> ()
12  }
13  return
14}
15
16// -----
17
18func @module_op() {
19  // expected-error@+1 {{region should have no arguments}}
20  module {
21  ^bb1(%arg: i32):
22    "module_terminator"() : () -> ()
23  }
24  return
25}
26
27// -----
28
29func @module_op() {
30  // expected-error@below {{expects regions to end with 'module_terminator'}}
31  // expected-note@below {{the absence of terminator implies 'module_terminator'}}
32  module {
33    return
34  }
35  return
36}
37
38// -----
39
40func @module_op() {
41  // expected-error@+1 {{expects parent op 'module'}}
42  "module_terminator"() : () -> ()
43}
44
45// -----
46
47// expected-error@+1 {{can only contain attributes with dialect-prefixed names}}
48module attributes {attr} {
49}
50
51