view mlir/test/Examples/Toy/Ch7/scalar.toy @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents c4bab56944e8
children
line wrap: on
line source

# RUN: toyc-ch7 %s -emit=mlir 2>&1 | FileCheck %s

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

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