27 lines · plain
1// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s -check-prefix=CPP-DEFAULT2// RUN: mlir-translate -mlir-to-cpp -declare-variables-at-top %s | FileCheck %s -check-prefix=CPP-DECLTOP3 4func.func @emitc_call_operand() {5 %p0 = emitc.literal "M_PI" : f326 %1 = emitc.call_opaque "foo"(%p0) : (f32) -> f327 return8}9// CPP-DEFAULT: void emitc_call_operand() {10// CPP-DEFAULT-NEXT: float v1 = foo(M_PI);11 12// CPP-DECLTOP: void emitc_call_operand() {13// CPP-DECLTOP-NEXT: float v1;14// CPP-DECLTOP-NEXT: v1 = foo(M_PI);15 16func.func @emitc_call_operand_arg() {17 %p0 = emitc.literal "M_PI" : f3218 %1 = emitc.call_opaque "bar"(%p0) {args = [42 : i32, 0 : index]} : (f32) -> f3219 return20}21// CPP-DEFAULT: void emitc_call_operand_arg() {22// CPP-DEFAULT-NEXT: float v1 = bar(42, M_PI);23 24// CPP-DECLTOP: void emitc_call_operand_arg() {25// CPP-DECLTOP-NEXT: float v1;26// CPP-DECLTOP-NEXT: v1 = bar(42, M_PI);27