llvm-project
51 строка · 2.0 Кб
1// # RUN: mlir-opt %s -split-input-file | mlir-opt |FileCheck %s
2// # RUN: mlir-opt %s -mlir-print-op-generic -split-input-file | mlir-opt -mlir-print-op-generic | FileCheck %s --check-prefix=GENERIC
3
4// CHECK: test.with_properties
5// CHECK-SAME: <{a = 32 : i64, array = array<i64: 1, 2, 3, 4>, b = "foo"}>{{$}}
6// GENERIC: "test.with_properties"()
7// GENERIC-SAME: <{a = 32 : i64, array = array<i64: 1, 2, 3, 4>, b = "foo"}> : () -> ()
8test.with_properties <{a = 32 : i64, array = array<i64: 1, 2, 3, 4>, b = "foo"}>
9
10// CHECK: test.with_nice_properties
11// CHECK-SAME: "foo bar" is -3{{$}}
12// GENERIC: "test.with_nice_properties"()
13// GENERIC-SAME: <{prop = {label = "foo bar", value = -3 : i32}}> : () -> ()
14test.with_nice_properties "foo bar" is -3
15
16// CHECK: test.with_wrapped_properties
17// CHECK-SAME: <{prop = "content for properties"}>{{$}}
18// GENERIC: "test.with_wrapped_properties"()
19// GENERIC-SAME: <{prop = "content for properties"}> : () -> ()
20test.with_wrapped_properties <{prop = "content for properties"}>
21
22// CHECK: test.using_property_in_custom
23// CHECK-SAME: [1, 4, 20]{{$}}
24// GENERIC: "test.using_property_in_custom"()
25// GENERIC-SAME: prop = array<i64: 1, 4, 20>
26test.using_property_in_custom [1, 4, 20]
27
28// CHECK: test.using_property_ref_in_custom
29// CHECK-SAME: 1 + 4 = 5{{$}}
30// GENERIC: "test.using_property_ref_in_custom"()
31// GENERIC-SAME: <{
32// GENERIC-SAME: first = 1
33// GENERIC-SAME: second = 4
34// GENERIC-SAME: }>
35test.using_property_ref_in_custom 1 + 4 = 5
36
37// CHECK: test.with_default_valued_properties {{$}}
38// GENERIC: "test.with_default_valued_properties"()
39// GENERIC-SAME: <{a = 0 : i32}>
40test.with_default_valued_properties <{a = 0 : i32}>
41
42// CHECK: test.with_optional_properties
43// CHECK-SAME: <{b = 0 : i32}>
44// GENERIC: "test.with_optional_properties"()
45// GENERIC-SAME: <{b = 0 : i32}>
46test.with_optional_properties <{b = 0 : i32}>
47
48// CHECK: test.with_optional_properties {{$}}
49// GENERIC: "test.with_optional_properties"()
50// GENERIC-SAME: : () -> ()
51test.with_optional_properties
52