diff --git a/lib/Interpreter/Interpreter.cpp b/lib/Interpreter/Interpreter.cpp index a9640ce6..6c915308 100644 --- a/lib/Interpreter/Interpreter.cpp +++ b/lib/Interpreter/Interpreter.cpp @@ -590,7 +590,7 @@ namespace cling { CompilationOptions CO; CO.DeclarationExtraction = 0; CO.ValuePrinting = CompilationOptions::VPEnabled; - CO.ResultEvaluation = 0; + CO.ResultEvaluation = (bool)V; return EvaluateInternal(input, CO, V); } diff --git a/test/Interfaces/echo.C b/test/Interfaces/echo.C new file mode 100644 index 00000000..6ec4f125 --- /dev/null +++ b/test/Interfaces/echo.C @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// CLING - the C++ LLVM-based InterpreterG :) +// +// This file is dual-licensed: you can choose to license it under the University +// of Illinois Open Source License or the GNU Lesser General Public License. See +// LICENSE.TXT for details. +//------------------------------------------------------------------------------ + +// RUN: cat %s | %cling 2>&1 | FileCheck %s + +#include "cling/Interpreter/Interpreter.h" +#include "cling/Interpreter/Value.h" + +gCling->echo("1;"); +// CHECK: 1 +cling::Value V; +gCling->echo("2;", &V); +V +// CHECK-NEXT: 2 +// CHECK-NEXT: (cling::Value) boxes [(const int) 2]