# RUN: python -m toy %s --emit=toy | filecheck %s
# RUN: python -m toy %s --emit=toy-opt | filecheck %s
# RUN: python -m toy %s --emit=toy-inline | filecheck %s
# RUN: python -m toy %s --emit=shape-inference | filecheck %s
# RUN: python -m toy %s --emit=affine | filecheck %s
# RUN: python -m toy %s --emit=scf | filecheck %s
# RUN: python -m toy %s --emit=riscv | filecheck %s
# RUN: python -m toy %s --emit=riscv-regalloc | filecheck %s
# RUN: python -m toy %s --emit=riscv-lowered | filecheck %s
# RUN: python -m toy %s --emit=riscv-asm | filecheck %s

# User defined generic function that operates on unknown shaped arguments
def multiply_transpose(a, b) {
  return transpose(a) * transpose(b);
}

def main() {
  var a<2, 3> = [[1, 2, 3], [4, 5, 6]];
  var b<2, 3> = [1, 2, 3, 4, 5, 6];
  var c = multiply_transpose(a, b);
  var d = multiply_transpose(b, a);
  print(d);
}

# CHECK{LITERAL}:       [[1.0, 16.0], [4.0, 25.0], [9.0, 36.0]]

# REGALLOC: riscv.reg<{{.+}}>
# REGALLOC-NOT: riscv.reg<>
