xref: /llvm-project/mlir/test/Examples/transform-opt/self-contained.mlir (revision 619ee20b3911f9a481a75a64704c80aef16af9d0)
1// RUN: mlir-transform-opt %s | FileCheck %s
2// RUN: mlir-transform-opt %s --transform=%s | FileCheck %s
3// RUN: mlir-transform-opt %s --transform=%p/external-decl.mlir --verify-diagnostics
4// RUN: mlir-transform-opt %s --transform=%p/external-def.mlir --transform-entry-point=external_def | FileCheck %s --check-prefix=EXTERNAL
5// RUN: mlir-transform-opt %s --transform=%p/external-decl.mlir --transform-library=%p/external-def.mlir | FileCheck %s --check-prefix=EXTERNAL
6// RUN: mlir-transform-opt %s --transform=%p/syntax-error.mlir --verify-diagnostics
7
8// CHECK: IR printer: in self-contained
9// EXTERNAL: IR printer: external_def
10
11// The first occurrence comes from the print operation and the second is the
12// roundtrip output. However, we shouldn't have the symbol duplicated because
13// of library merging.
14// CHECK-COUNT-2: @__transform_main
15// CHECK-NOT: @__transform_main
16module attributes {transform.with_named_sequence} {
17  transform.named_sequence private @__transform_main(%root: !transform.any_op) {
18    transform.print %root { name = "in self-contained" } : !transform.any_op
19    transform.yield
20  }
21}
22