16 lines · plain
1// RUN: toyc-ch7 %s -emit=mlir -opt 2>&1 | FileCheck %s2 3toy.func @main() {4 %0 = toy.struct_constant [5 [dense<4.000000e+00> : tensor<2x2xf64>], dense<4.000000e+00> : tensor<2x2xf64>6 ] : !toy.struct<!toy.struct<tensor<*xf64>>, tensor<*xf64>>7 %1 = toy.struct_access %0[0] : !toy.struct<!toy.struct<tensor<*xf64>>, tensor<*xf64>> -> !toy.struct<tensor<*xf64>>8 %2 = toy.struct_access %1[0] : !toy.struct<tensor<*xf64>> -> tensor<*xf64>9 toy.print %2 : tensor<*xf64>10 toy.return11}12 13// CHECK-LABEL: toy.func @main14// CHECK-NEXT: %[[CST:.*]] = toy.constant dense<4.015// CHECK-NEXT: toy.print %[[CST]]16