brintos

brintos / llvm-project-archived public Read only

0
0
Text · 578 B · df74fd4 Raw
17 lines · plain
1# RUN: toyc-ch5 %s -emit=mlir -opt 2>&1 | FileCheck %s2 3# User defined generic function that operates on unknown shaped arguments4def transpose_transpose(x) {5  return transpose(transpose(x));6}7 8def main() {9  var a<2, 3> = [[1, 2, 3], [4, 5, 6]];10  var b = transpose_transpose(a);11  print(b);12}13 14# CHECK-LABEL: toy.func @main()15# 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>16# CHECK-NEXT:    toy.print [[VAL_1]] : tensor<2x3xf64>17# CHECK-NEXT:    toy.return