summaryrefslogtreecommitdiffstats
path: root/mlir/test/Examples/Toy/Ch5/scalar.toy
blob: 2743b5a3ac94f636507bd0907f481f81676ef62c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# RUN: toyc-ch5 %s -emit=mlir 2>&1 | FileCheck %s

def main() {
  var a<2, 2> = 5.5;
  print(a);
}

# CHECK-LABEL: func @main() {
# CHECK-NEXT:    %0 = "toy.constant"() {value = dense<5.500000e+00> : tensor<f64>} : () -> tensor<f64>
# CHECK-NEXT:    %1 = "toy.reshape"(%0) : (tensor<f64>) -> tensor<2x2xf64>
# CHECK-NEXT:    "toy.print"(%1) : (tensor<2x2xf64>) -> ()
# CHECK-NEXT:    "toy.return"() : () -> ()
# CHECK-NEXT:  }

OpenPOWER on IntegriCloud