1a6b42716SLucy Fox# RUN: toyc-ch3 %s -emit=mlir -opt 2>&1 | FileCheck %s 2495cf272SLucy Fox 3495cf272SLucy Fox# User defined generic function that operates on unknown shaped arguments 4495cf272SLucy Foxdef transpose_transpose(x) { 5495cf272SLucy Fox return transpose(transpose(x)); 6495cf272SLucy Fox} 7495cf272SLucy Fox 8495cf272SLucy Foxdef main() { 9495cf272SLucy Fox var a<2, 3> = [[1, 2, 3], [4, 5, 6]]; 10495cf272SLucy Fox var b = transpose_transpose(a); 11495cf272SLucy Fox print(b); 12495cf272SLucy Fox} 13495cf272SLucy Fox 14*ee2c6cd9SRiver Riddle# CHECK-LABEL: toy.func @transpose_transpose( 15495cf272SLucy Fox# CHECK-SAME: [[VAL_0:%.*]]: tensor<*xf64>) -> tensor<*xf64> 16a6b42716SLucy Fox# CHECK-NEXT: toy.return [[VAL_0]] : tensor<*xf64> 17495cf272SLucy Fox 18*ee2c6cd9SRiver Riddle# CHECK-LABEL: toy.func @main() 19a6b42716SLucy Fox# CHECK-NEXT: [[VAL_1:%.*]] = toy.constant dense<{{\[\[}}1.000000e+00, 2.000000e+00, 3.000000e+00], [4.000000e+00, 5.000000e+00, 6.000000e+00]]> : tensor<2x3xf64> 20a6b42716SLucy Fox# CHECK-NEXT: [[VAL_2:%.*]] = toy.generic_call @transpose_transpose([[VAL_1]]) : (tensor<2x3xf64>) -> tensor<*xf64> 21a6b42716SLucy Fox# CHECK-NEXT: toy.print [[VAL_2]] : tensor<*xf64> 22495cf272SLucy Fox# CHECK-NEXT: toy.return