xref: /llvm-project/mlir/test/Examples/Toy/Ch5/trivial_reshape.toy (revision ee2c6cd9069fe0d8e7386ce53300e7645e4db792)
1# RUN: toyc-ch5 %s -emit=mlir -opt 2>&1 | FileCheck %s
2
3def main() {
4  var a<2,1> = [1, 2];
5  var b<2,1> = a;
6  var c<2,1> = b;
7  print(c);
8}
9
10# CHECK-LABEL: toy.func @main()
11# CHECK-NEXT:    [[VAL_0:%.*]] = toy.constant
12# CHECK-SAME: 		dense<[
13# CHECK-SAME: 	 	[1.000000e+00], [2.000000e+00]
14# CHECK-SAME: 		]> : tensor<2x1xf64>
15# CHECK-NEXT:    toy.print [[VAL_0]] : tensor<2x1xf64>
16# CHECK-NEXT:    toy.return
17