1// RUN: mlir-translate -mlir-to-cpp %s | FileCheck %s -check-prefix=CPP-DEFAULT 2// RUN: mlir-translate -mlir-to-cpp -declare-variables-at-top %s | FileCheck %s -check-prefix=CPP-DECLTOP 3 4func.func @emitc_call_opaque() { 5 %0 = emitc.call_opaque "func_a" () : () -> i32 6 %1 = emitc.call_opaque "func_b" () : () -> i32 7 return 8} 9// CPP-DEFAULT: void emitc_call_opaque() { 10// CPP-DEFAULT-NEXT: int32_t [[V0:[^ ]*]] = func_a(); 11// CPP-DEFAULT-NEXT: int32_t [[V1:[^ ]*]] = func_b(); 12 13// CPP-DECLTOP: void emitc_call_opaque() { 14// CPP-DECLTOP-NEXT: int32_t [[V0:[^ ]*]]; 15// CPP-DECLTOP-NEXT: int32_t [[V1:[^ ]*]]; 16// CPP-DECLTOP-NEXT: [[V0:]] = func_a(); 17// CPP-DECLTOP-NEXT: [[V1:]] = func_b(); 18 19 20func.func @emitc_call_opaque_two_results() { 21 %0 = "emitc.constant"() <{value = 0 : index}> : () -> index 22 %1:2 = emitc.call_opaque "two_results" () : () -> (i32, i32) 23 return 24} 25// CPP-DEFAULT: void emitc_call_opaque_two_results() { 26// CPP-DEFAULT-NEXT: size_t [[V1:[^ ]*]] = 0; 27// CPP-DEFAULT-NEXT: int32_t [[V2:[^ ]*]]; 28// CPP-DEFAULT-NEXT: int32_t [[V3:[^ ]*]]; 29// CPP-DEFAULT-NEXT: std::tie([[V2]], [[V3]]) = two_results(); 30 31// CPP-DECLTOP: void emitc_call_opaque_two_results() { 32// CPP-DECLTOP-NEXT: size_t [[V1:[^ ]*]]; 33// CPP-DECLTOP-NEXT: int32_t [[V2:[^ ]*]]; 34// CPP-DECLTOP-NEXT: int32_t [[V3:[^ ]*]]; 35// CPP-DECLTOP-NEXT: [[V1]] = 0; 36// CPP-DECLTOP-NEXT: std::tie([[V2]], [[V3]]) = two_results(); 37