Skip to content

Commit

Permalink
Review comments: use the ref keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
cferry-AMD committed Sep 6, 2024
1 parent d117c49 commit 2137c0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions mlir/test/Target/Cpp/common-cpp.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,8 @@ func.func @array_type(%arg0: !emitc.array<3xi32>, %arg1: !emitc.array<10x20xf32>
func.func @arg_references(%arg0: !emitc.array<3xi32> {emitc.reference}, %arg1: !emitc.array<10x20xf32> {emitc.reference}, %arg2: i32 {emitc.reference}) {
return
}

// CHECK: void emitc_arg_references(int32_t (&v1)[3], float (&v2)[10][20], int32_t &v3)
emitc.func @emitc_arg_references(%arg0: !emitc.array<3xi32> ref, %arg1: !emitc.array<10x20xf32> ref, %arg2: i32 ref) {
emitc.return
}
4 changes: 2 additions & 2 deletions mlir/test/Target/Cpp/declare_func.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ emitc.func @array_arg(%arg0: !emitc.array<3xi32>) {
// CHECK: void reference_scalar_arg(int32_t &[[V2:[^ ]*]]);
emitc.declare_func @reference_scalar_arg
// CHECK: void reference_scalar_arg(int32_t &[[V2:[^ ]*]]) {
emitc.func @reference_scalar_arg(%arg0: i32 {emitc.reference}) {
emitc.func @reference_scalar_arg(%arg0: i32 ref) {
emitc.return
}

// CHECK: void reference_array_arg(int32_t (&[[V2:[^ ]*]])[3]);
emitc.declare_func @reference_array_arg
// CHECK: void reference_array_arg(int32_t (&[[V2:[^ ]*]])[3]) {
emitc.func @reference_array_arg(%arg0: !emitc.array<3xi32> {emitc.reference}) {
emitc.func @reference_array_arg(%arg0: !emitc.array<3xi32> ref) {
emitc.return
}

0 comments on commit 2137c0f

Please sign in to comment.