cling/test/Prompt/Regression.C
Vassil Vassilev c86fbc27b9 Rewire the dumping on cling::Value to its new implementation.
Dump cling::Value within setNoAlloc routines because this is its lifespan,
otherwise gets deleted if nobody requested it. I.e it was created only for
value printing purposes.

Dump cling::Value outside setWithAlloc because the actual value is not put inside
until the call to ::new finishes, thus we need to do it outside, i.e in EvaluateInternal.

Switch on the ValueExtraction synthesizer even when 'just' value printing. We
depend on it. Must be factored out properly in one class.

Stop attaching the value printing template magic, which didn't work in some cases.

Update the ref file, because now there is better type information.

Adapt the user-defined printout functions (TDatime).
2014-05-18 18:08:58 +02:00

38 lines
1.3 KiB
C

//------------------------------------------------------------------------------
// 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 -I%p | FileCheck %s
// This file should be used as regression test for the meta processing subsystem
// Reproducers of fixed bugs should be put here
// PR #96277
#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/Value.h"
#include <stdio.h>
gCling->declare("int print() { printf(\"print is run.\\n\"); return 1; }");
cling::Value V;
gCling->process("int a = print();",&V);
//CHECK: print is run.
gCling->process("a", &V);
//CHECK: (int) 1
gCling->process("a;", &V);
//CHECK-NOT: print is run.
// End PR #96277
// PR #98146
gCling->process("\"Root\"", &V);
// CHECK: (const char [5]) "Root"
V
// CHECK: (cling::Value &) boxes [(const char [5]) "Root"]
// End PR #98146
typedef enum {k1,k2} enumName;
enumName var
// CHECK: (enumName) (::k1) : (int) 0
const enumName constVar = (enumName) 1 // k2 is invisible!
// CHECK: (const enumName) (::k2) : (int) 1