If cling::Value is provided turn result evaluation on.

This commit is contained in:
Vassil Vassilev 2014-04-11 14:05:53 +02:00 committed by sftnight
parent 59c7b7b2d7
commit 9b4ea193c0
2 changed files with 21 additions and 1 deletions

View File

@ -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);
}

20
test/Interfaces/echo.C Normal file
View File

@ -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]