49 lines · plain
1// RUN: mlir-opt %s \2// RUN: -pass-pipeline="builtin.module( \3// RUN: convert-math-to-funcs{convert-ctlz}, \4// RUN: func.func(convert-scf-to-cf,convert-arith-to-llvm), \5// RUN: convert-func-to-llvm, \6// RUN: convert-cf-to-llvm, \7// RUN: reconcile-unrealized-casts)" \8// RUN: | mlir-runner -e test_7i32_to_29 -entry-point-result=i32 | FileCheck %s --check-prefix=CHECK_TEST_7i32_TO_299 10func.func @test_7i32_to_29() -> i32 {11 %arg = arith.constant 7 : i3212 %0 = math.ctlz %arg : i3213 func.return %0 : i3214}15// CHECK_TEST_7i32_TO_29: 2916 17// RUN: mlir-opt %s \18// RUN: -pass-pipeline="builtin.module( \19// RUN: convert-math-to-funcs{convert-ctlz}, \20// RUN: func.func(convert-scf-to-cf,convert-arith-to-llvm), \21// RUN: convert-func-to-llvm, \22// RUN: convert-cf-to-llvm, \23// RUN: reconcile-unrealized-casts)" \24// RUN: | mlir-runner -e test_zero -entry-point-result=i32 | FileCheck %s --check-prefix=CHECK_TEST_ZERO25 26func.func @test_zero() -> i32 {27 %arg = arith.constant 0 : i3228 %0 = math.ctlz %arg : i3229 func.return %0 : i3230}31// CHECK_TEST_ZERO: 3232 33// Apparently mlir-runner doesn't support i8 return values, so testing i64 instead34// RUN: mlir-opt %s \35// RUN: -pass-pipeline="builtin.module( \36// RUN: convert-math-to-funcs, \37// RUN: func.func(convert-scf-to-cf,convert-arith-to-llvm), \38// RUN: convert-func-to-llvm, \39// RUN: convert-cf-to-llvm, \40// RUN: reconcile-unrealized-casts)" \41// RUN: | mlir-runner -e test_7i64_to_61 -entry-point-result=i64 | FileCheck %s --check-prefix=CHECK_TEST_7i64_TO_6142 43func.func @test_7i64_to_61() -> i64 {44 %arg = arith.constant 7 : i6445 %0 = math.ctlz %arg : i6446 func.return %0 : i6447}48// CHECK_TEST_7i64_TO_61: 6149