2018-06-23 01:39:19 +08:00
|
|
|
; TODO(andydavis) Resolve relative path issue w.r.t invoking mlir-opt in RUN
|
|
|
|
; statements (perhaps through using lit config substitutions).
|
|
|
|
;
|
|
|
|
; RUN: %S/../../mlir-opt %s -o - | FileCheck %s
|
|
|
|
|
|
|
|
|
2018-06-23 13:03:48 +08:00
|
|
|
; CHECK: extfunc @foo(i32, i64) -> f32
|
2018-06-23 06:52:02 +08:00
|
|
|
extfunc @foo(i32, i64) -> f32
|
2018-06-23 01:39:19 +08:00
|
|
|
|
|
|
|
; CHECK: extfunc @bar()
|
2018-06-23 06:52:02 +08:00
|
|
|
extfunc @bar() -> ()
|
2018-06-23 01:39:19 +08:00
|
|
|
|
2018-06-30 13:08:05 +08:00
|
|
|
; CHECK: extfunc @baz() -> (i1, affineint, f32)
|
|
|
|
extfunc @baz() -> (i1, affineint, f32)
|
2018-06-23 01:39:19 +08:00
|
|
|
|
2018-06-23 06:52:02 +08:00
|
|
|
; CHECK: extfunc @missingReturn()
|
|
|
|
extfunc @missingReturn()
|
|
|
|
|
2018-06-30 13:08:05 +08:00
|
|
|
; CHECK: extfunc @int_types(i1, i2, i4, i7, i87) -> (i1, affineint, i19)
|
|
|
|
extfunc @int_types(i1, i2, i4, i7, i87) -> (i1, affineint, i19)
|
|
|
|
|
2018-06-23 06:52:02 +08:00
|
|
|
|
2018-06-23 13:03:48 +08:00
|
|
|
; CHECK: extfunc @vectors(vector<1xf32>, vector<2x4xf32>)
|
2018-06-23 06:52:02 +08:00
|
|
|
extfunc @vectors(vector<1 x f32>, vector<2x4xf32>)
|
|
|
|
|
2018-06-30 13:08:05 +08:00
|
|
|
; CHECK: extfunc @tensors(tensor<??f32>, tensor<??vector<2x4xf32>>, tensor<1x?x4x?x?xaffineint>, tensor<i8>)
|
2018-06-23 06:52:02 +08:00
|
|
|
extfunc @tensors(tensor<?? f32>, tensor<?? vector<2x4xf32>>,
|
2018-06-30 13:08:05 +08:00
|
|
|
tensor<1x?x4x?x?xaffineint>, tensor<i8>)
|
2018-06-23 06:52:02 +08:00
|
|
|
|
2018-06-23 13:03:48 +08:00
|
|
|
; CHECK: extfunc @memrefs(i1, i1)
|
2018-06-30 13:08:05 +08:00
|
|
|
extfunc @memrefs(memref<1x?x4x?x?xaffineint>, memref<i8>)
|
2018-06-23 13:03:48 +08:00
|
|
|
|
|
|
|
; CHECK: extfunc @functions((i1, i1) -> (), () -> ())
|
2018-06-30 13:08:05 +08:00
|
|
|
extfunc @functions((memref<1x?x4x?x?xaffineint>, memref<i8>) -> (), ()->())
|
2018-06-24 07:03:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
; CHECK-LABEL: cfgfunc @simpleCFG() {
|
|
|
|
cfgfunc @simpleCFG() {
|
|
|
|
bb42: ; CHECK: bb0:
|
2018-06-29 11:45:33 +08:00
|
|
|
"foo"() ; CHECK: "foo"()
|
|
|
|
"bar"() ; CHECK: "bar"()
|
2018-06-24 07:03:42 +08:00
|
|
|
return ; CHECK: return
|
|
|
|
} ; CHECK: }
|
|
|
|
|
|
|
|
; CHECK-LABEL: cfgfunc @multiblock() -> i32 {
|
|
|
|
cfgfunc @multiblock() -> i32 {
|
|
|
|
bb0: ; CHECK: bb0:
|
2018-06-25 02:18:29 +08:00
|
|
|
return ; CHECK: return
|
|
|
|
bb1: ; CHECK: bb1:
|
|
|
|
br bb4 ; CHECK: br bb3
|
|
|
|
bb2: ; CHECK: bb2:
|
|
|
|
br bb2 ; CHECK: br bb2
|
|
|
|
bb4: ; CHECK: bb3:
|
|
|
|
return ; CHECK: return
|
2018-06-24 07:03:42 +08:00
|
|
|
} ; CHECK: }
|
2018-06-29 08:02:32 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: mlfunc @simpleMLF() {
|
|
|
|
mlfunc @simpleMLF() {
|
2018-07-04 08:51:28 +08:00
|
|
|
return ; CHECK: return
|
2018-06-29 08:02:32 +08:00
|
|
|
} ; CHECK: }
|
|
|
|
|
2018-07-04 08:51:28 +08:00
|
|
|
; CHECK-LABEL: mlfunc @loops() {
|
|
|
|
mlfunc @loops() {
|
|
|
|
for { ; CHECK: for {
|
|
|
|
for { ; CHECK: for {
|
|
|
|
} ; CHECK: }
|
|
|
|
} ; CHECK: }
|
|
|
|
return ; CHECK: return
|
|
|
|
} ; CHECK: }
|
|
|
|
|
|
|
|
; CHECK-LABEL: mlfunc @ifstmt() {
|
|
|
|
mlfunc @ifstmt() {
|
|
|
|
for { ; CHECK for {
|
|
|
|
if { ; CHECK if {
|
|
|
|
} else if { ; CHECK } else if {
|
|
|
|
} else { ; CHECK } else {
|
|
|
|
} ; CHECK }
|
|
|
|
} ; CHECK }
|
|
|
|
return ; CHECK return
|
|
|
|
} ; CHECK }
|
2018-07-05 11:45:39 +08:00
|
|
|
|
|
|
|
; CHECK-LABEL: cfgfunc @attributes() {
|
|
|
|
cfgfunc @attributes() {
|
|
|
|
bb42: ; CHECK: bb0:
|
|
|
|
|
|
|
|
; CHECK: "foo"()
|
|
|
|
"foo"(){}
|
|
|
|
|
|
|
|
; CHECK: "foo"(){a: 1, b: -423, c: [true, false]}
|
|
|
|
"foo"(){a: 1, b: -423, c: [true, false] }
|
|
|
|
|
|
|
|
; CHECK: "foo"(){if: "foo", cfgfunc: [], i123: 7}
|
|
|
|
"foo"(){if: "foo", cfgfunc: [], i123: 7}
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|