2014-01-07 11:57:02 +01:00
//------------------------------------------------------------------------------
// 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.
//------------------------------------------------------------------------------
2012-09-05 09:37:39 +00:00
// 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"
2012-10-05 12:09:51 +00:00
# include "cling/Interpreter/StoredValueRef.h"
2012-09-05 09:37:39 +00:00
# include <stdio.h>
gCling - > declare ( " int print() { printf( \" print is run. \\ n \" ); return 1; } " ) ;
2012-10-05 12:09:51 +00:00
cling : : StoredValueRef V ;
2012-09-05 09:37:39 +00:00
gCling - > process ( " int a = print(); " , & V ) ;
//CHECK: print is run.
gCling - > process ( " a " , & V ) ;
2012-10-15 13:42:09 +00:00
//CHECK: (int) 1
2012-09-05 09:37:39 +00:00
gCling - > process ( " a; " , & V ) ;
//CHECK-NOT: print is run.
// End PR #96277
2012-10-15 13:57:36 +00:00
// PR #98146
gCling - > process ( " \" Root \" " , & V ) ;
2012-11-11 16:05:30 +00:00
// CHECK: (const char [5]) "Root"
2012-10-15 13:57:36 +00:00
V
2012-11-11 16:13:02 +00:00
// CHECK: (cling::StoredValueRef) boxes [(const char *) "Root"]
2014-02-14 10:12:00 +01:00
// End PR #98146
2014-02-13 11:41:03 +01:00
typedef enum { k1 , k2 } enumName ;
enumName var
2014-02-07 15:14:16 +01:00
// CHECK: (enumName) (::k1) : (int) 0
2014-02-19 15:52:01 +01:00
const enumName constVar = ( enumName ) 1 // k2 is invisible!
// CHECK: (const enumName) (::k2) : (int) 1