• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: mlir-opt -test-print-nesting  -allow-unregistered-dialect %s | FileCheck %s
2
3// CHECK: visiting op: 'module' with 0 operands and 0 results
4// CHECK:  1 nested regions:
5// CHECK:   Region with 1 blocks:
6// CHECK:     Block with 0 arguments, 0 successors, and 3 operations
7module {
8
9
10// CHECK:       visiting op: 'dialect.op1' with 0 operands and 4 results
11// CHECK:       1 attributes:
12// CHECK:        - 'attribute name' : '42 : i32'
13// CHECK:        0 nested regions:
14  %results:4 = "dialect.op1"() { "attribute name" = 42 : i32 } : () -> (i1, i16, i32, i64)
15
16
17// CHECK:       visiting op: 'dialect.op2' with 0 operands and 0 results
18// CHECK:        2 nested regions:
19  "dialect.op2"() ({
20
21// CHECK:         Region with 1 blocks:
22// CHECK:           Block with 0 arguments, 0 successors, and 1 operations
23// CHECK:             visiting op: 'dialect.innerop1' with 2 operands and 0 results
24// CHECK:              0 nested regions:
25    "dialect.innerop1"(%results#0, %results#1) : (i1, i16) -> ()
26
27// CHECK:         Region with 3 blocks:
28  },{
29
30// CHECK:           Block with 0 arguments, 2 successors, and 2 operations
31// CHECK:             visiting op: 'dialect.innerop2' with 0 operands and 0 results
32// CHECK:              0 nested regions:
33    "dialect.innerop2"() : () -> ()
34// CHECK:             visiting op: 'dialect.innerop3' with 3 operands and 0 results
35// CHECK:              0 nested regions:
36    "dialect.innerop3"(%results#0, %results#2, %results#3)[^bb1, ^bb2] : (i1, i32, i64) -> ()
37// CHECK:           Block with 1 arguments, 0 successors, and 2 operations
38  ^bb1(%arg1 : i32):
39// CHECK:             visiting op: 'dialect.innerop4' with 0 operands and 0 results
40// CHECK:              0 nested regions:
41    "dialect.innerop4"() : () -> ()
42// CHECK:             visiting op: 'dialect.innerop5' with 0 operands and 0 results
43// CHECK:              0 nested regions:
44    "dialect.innerop5"() : () -> ()
45// CHECK:           Block with 1 arguments, 0 successors, and 2 operations
46  ^bb2(%arg2 : i64):
47// CHECK:             visiting op: 'dialect.innerop6' with 0 operands and 0 results
48// CHECK:              0 nested regions:
49    "dialect.innerop6"() : () -> ()
50// CHECK:             visiting op: 'dialect.innerop7' with 0 operands and 0 results
51// CHECK:              0 nested regions:
52    "dialect.innerop7"() : () -> ()
53  }) : () -> ()
54
55// CHECK:       visiting op: 'module_terminator' with 0 operands and 0 results
56
57} // module
58