diff --git a/test/Transforms/Substrait/emit-deduplication.mlir b/test/Transforms/Substrait/emit-deduplication.mlir index f7d329f5d7fb..8324aa9bf2d5 100644 --- a/test/Transforms/Substrait/emit-deduplication.mlir +++ b/test/Transforms/Substrait/emit-deduplication.mlir @@ -286,3 +286,27 @@ substrait.plan version 0 : 42 : 1 { yield %1 : tuple } } + +// ----- + +// End-to-end test of many patterns related to `project`. + +// CHECK-LABEL: substrait.plan +// CHECK-NEXT: relation +// CHECK-NEXT: %[[V0:.*]] = named_table +// CHECK-NEXT: %[[V1:.*]] = emit [1, 1, 1, 1] from %[[V0]] : +// CHECK-NEXT: yield %[[V1]] : tuple + +substrait.plan version 0 : 42 : 1 { + relation { + %0 = named_table @t1 as ["a", "b"] : tuple + %1 = emit [1, 1] from %0 : tuple -> tuple + %2 = project %1 : tuple -> tuple { + ^bb0(%arg : tuple): + %3 = field_reference %arg[[0]] : tuple + %4 = field_reference %arg[[1]] : tuple + yield %3, %4 : si32, si32 + } + yield %2 : tuple + } +}