1// RUN: mlir-opt -allow-unregistered-dialect %s -split-input-file -mlir-print-debuginfo -mlir-print-local-scope | FileCheck %s 2 3// CHECK: module { 4module { 5} 6 7// CHECK: module { 8// CHECK-NEXT: } 9module { 10 "module_terminator"() : () -> () 11} 12 13// CHECK: module attributes {foo.attr = true} { 14module attributes {foo.attr = true} { 15} 16 17// CHECK: module { 18module { 19 // CHECK-NEXT: "foo.result_op"() : () -> i32 20 %result = "foo.result_op"() : () -> i32 21} 22 23// ----- 24 25// Check that a top-level module is always created, with location info. 26// CHECK: module { 27// CHECK-NEXT: } loc({{.*}}module-op.mlir{{.*}}) 28 29// ----- 30 31// Check that the top-level module can be defined via a single module operation. 32// CHECK: module { 33// CHECK-NOT: module { 34module { 35} 36 37// ----- 38 39// Check that the implicit top-level module is also a name scope for SSA 40// values. This should not crash. 41// CHECK: module { 42// CHECK: %{{.*}} = "op" 43// CHECK: } 44%0 = "op"() : () -> i32 45 46// ----- 47 48// CHECK-LABEL: module @foo 49// CHECK-NOT: attributes 50module @foo { 51 // CHECK: module 52 module { 53 // CHECK: module @bar attributes 54 module @bar attributes {foo.bar} { 55 } 56 } 57} 58