diff options
Diffstat (limited to 'mlir/test/Examples/Toy/Ch7/scalar.toy')
| -rw-r--r-- | mlir/test/Examples/Toy/Ch7/scalar.toy | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mlir/test/Examples/Toy/Ch7/scalar.toy b/mlir/test/Examples/Toy/Ch7/scalar.toy new file mode 100644 index 00000000000..f917ea622e5 --- /dev/null +++ b/mlir/test/Examples/Toy/Ch7/scalar.toy @@ -0,0 +1,14 @@ +# RUN: toyc-ch7 %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: } + |

