aboutsummaryrefslogtreecommitdiff
path: root/mlir/test/Examples/Toy/Ch7/trivial_reshape.toy
blob: 06df1c1cc6e52fcd61b97479915eb01ff8bb8668 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# RUN: toyc-ch7 %s -emit=mlir -opt 2>&1 | FileCheck %s

def main() {
  var a<2,1> = [1, 2];
  var b<2,1> = a;
  var c<2,1> = b;
  print(c);
}

# CHECK-LABEL: toy.func @main()
# CHECK-NEXT:    [[VAL_0:%.*]] = toy.constant
# CHECK-SAME: 		dense<[
# CHECK-SAME: 	 	[1.000000e+00], [2.000000e+00]
# CHECK-SAME: 		]> : tensor<2x1xf64>
# CHECK-NEXT:    toy.print [[VAL_0]] : tensor<2x1xf64>
# CHECK-NEXT:    toy.return