Mercurial > hg > CbC > CbC_llvm
diff mlir/test/mlir-tblgen/op-format.mlir @ 173:0572611fdcc8 llvm10 llvm12
reorgnization done
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 11:55:54 +0900 |
parents | 1d019706d866 |
children | 2e18cbf3894f |
line wrap: on
line diff
--- a/mlir/test/mlir-tblgen/op-format.mlir Mon May 25 11:50:15 2020 +0900 +++ b/mlir/test/mlir-tblgen/op-format.mlir Mon May 25 11:55:54 2020 +0900 @@ -1,4 +1,4 @@ -// RUN: mlir-opt %s | mlir-opt -verify-diagnostics | FileCheck %s +// RUN: mlir-opt -allow-unregistered-dialect %s | mlir-opt -allow-unregistered-dialect -verify-diagnostics | FileCheck %s // CHECK: %[[I64:.*]] = %i64 = "foo.op"() : () -> (i64) @@ -12,9 +12,23 @@ // CHECK-NOT: {attr test.format_attr_op 10 +// CHECK: test.format_opt_attr_op(10) +// CHECK-NOT: {opt_attr +test.format_opt_attr_op(10) + +// CHECK: test.format_attr_dict_w_keyword attributes {attr = 10 : i64} +test.format_attr_dict_w_keyword attributes {attr = 10 : i64} + +// CHECK: test.format_attr_dict_w_keyword attributes {attr = 10 : i64, opt_attr = 10 : i64} +test.format_attr_dict_w_keyword attributes {attr = 10 : i64, opt_attr = 10 : i64} + // CHECK: test.format_buildable_type_op %[[I64]] %ignored = test.format_buildable_type_op %i64 +//===----------------------------------------------------------------------===// +// Format results +//===----------------------------------------------------------------------===// + // CHECK: test.format_result_a_op memref<1xf64> %ignored_a:2 = test.format_result_a_op memref<1xf64> @@ -24,6 +38,10 @@ // CHECK: test.format_result_c_op (i64) -> memref<1xf64> %ignored_c:2 = test.format_result_c_op (i64) -> memref<1xf64> +//===----------------------------------------------------------------------===// +// Format operands +//===----------------------------------------------------------------------===// + // CHECK: test.format_operand_a_op %[[I64]], %[[MEMREF]] : i64, memref<1xf64> test.format_operand_a_op %i64, %memref : i64, memref<1xf64> @@ -38,3 +56,48 @@ // CHECK: test.format_operand_e_op %[[I64]], %[[MEMREF]] : i64, memref<1xf64> test.format_operand_e_op %i64, %memref : i64, memref<1xf64> + +//===----------------------------------------------------------------------===// +// Format successors +//===----------------------------------------------------------------------===// + +"foo.successor_test_region"() ( { + ^bb0: + // CHECK: test.format_successor_a_op ^bb1 {attr} + test.format_successor_a_op ^bb1 {attr} + + ^bb1: + // CHECK: test.format_successor_a_op ^bb1, ^bb2 {attr} + test.format_successor_a_op ^bb1, ^bb2 {attr} + + ^bb2: + // CHECK: test.format_successor_a_op {attr} + test.format_successor_a_op {attr} + +}) { arg_names = ["i", "j", "k"] } : () -> () + +//===----------------------------------------------------------------------===// +// Format optional operands and results +//===----------------------------------------------------------------------===// + +// CHECK: test.format_optional_operand_result_a_op(%[[I64]] : i64) : i64 +test.format_optional_operand_result_a_op(%i64 : i64) : i64 + +// CHECK: test.format_optional_operand_result_a_op( : ) : i64 +test.format_optional_operand_result_a_op( : ) : i64 + +// CHECK: test.format_optional_operand_result_a_op(%[[I64]] : i64) : +// CHECK-NOT: i64 +test.format_optional_operand_result_a_op(%i64 : i64) : + +// CHECK: test.format_optional_operand_result_a_op(%[[I64]] : i64) : [%[[I64]], %[[I64]]] +test.format_optional_operand_result_a_op(%i64 : i64) : [%i64, %i64] + +// CHECK: test.format_optional_operand_result_b_op(%[[I64]] : i64) : i64 +test.format_optional_operand_result_b_op(%i64 : i64) : i64 + +// CHECK: test.format_optional_operand_result_b_op : i64 +test.format_optional_operand_result_b_op( : ) : i64 + +// CHECK: test.format_optional_operand_result_b_op : i64 +test.format_optional_operand_result_b_op : i64