Newer
Older
Vassil Vassilev
committed
// RUN: cat %s | %cling -Xclang -verify | FileCheck %s
#include "cling/Interpreter/Interpreter.h"
Axel Naumann
committed
#include "cling/Interpreter/StoredValueRef.h"
Axel Naumann
committed
cling::StoredValueRef V;
V // CHECK: (cling::StoredValueRef) <<<invalid>>> @0x{{.*}}
gCling->evaluate("1;", &V);
Axel Naumann
committed
V // CHECK: (cling::StoredValueRef) boxes [(int) 1]
long LongV = 17;
gCling->evaluate("LongV;", &V);
Axel Naumann
committed
V // CHECK: (cling::StoredValueRef) boxes [(long) 17]
int* IntP = (int*)0x12;
gCling->evaluate("IntP;", &V);
Axel Naumann
committed
V // CHECK: (cling::StoredValueRef) boxes [(int *) 0x12]
Axel Naumann
committed
cling::StoredValueRef Result;
gCling->evaluate("V", &Result);
Vassil Vassilev
committed
Result // CHECK: (cling::StoredValueRef) boxes [(cling::StoredValueRef)]
Axel Naumann
committed
V // CHECK: (cling::StoredValueRef) boxes [(int *) 0x12]
// Savannah #96277
gCling->evaluate("double sin(double); double one = sin(3.141/2);", &V);
Vassil Vassilev
committed
V // CHECK: (cling::StoredValueRef) boxes [(void)]
one // expected-error {{use of undeclared identifier 'one'}}