Skip to content
Snippets Groups Projects
evaluate.C 1.12 KiB
Newer Older
// RUN: cat %s | %cling -Xclang -verify
// RUN: cat %s | %cling | FileCheck %s

#include "cling/Interpreter/Interpreter.h"
#include "cling/Interpreter/StoredValueRef.h"
cling::StoredValueRef V;
V // CHECK: (cling::StoredValueRef) <<<invalid>>> @0x{{.*}}
V // CHECK: (cling::StoredValueRef) boxes [(int) 1]
V // CHECK: (cling::StoredValueRef) boxes [(long) 17]
V // CHECK: (cling::StoredValueRef) boxes [(int *) 0x12]
Result // CHECK: (cling::StoredValueRef) boxes [(cling::StoredValueRef)]
V // CHECK: (cling::StoredValueRef) boxes [(int *) 0x12]
gCling->evaluate("double sin(double); double one = sin(3.141/2);", V);
V // CHECK: (cling::StoredValueRef) boxes [(double) 1.000000e+00]

gCling->process("double sin(double); double one = sin(3.141/2);", &V);
V // CHECK: (cling::StoredValueRef) boxes [(double) 1.000000e+00]
one // CHECK: (double) 1.000
int one; // expected-error {{saying something like redecl but verify is broken!}}