xref: /llvm-project/mlir/test/Target/Cpp/unary_operators.mlir (revision df9be017b7828e0a1dbb4f1f507a92266b61e680)
1// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s
2
3func.func @unary(%arg0: i32) -> () {
4  %0 = emitc.unary_minus %arg0 : (i32) -> i32
5  %1 = emitc.unary_plus %arg0 : (i32) -> i32
6
7  return
8}
9
10// CHECK-LABEL: void unary
11// CHECK-NEXT:  int32_t [[V1:[^ ]*]] = -[[V0:[^ ]*]];
12// CHECK-NEXT:  int32_t [[V2:[^ ]*]] = +[[V0]];
13