cling/test/CodeUnloading/Simple.C
Vassil Vassilev 8f257e74d3 Create a virtual file entry for each input line.
This is the only way not to confuse the diagnostics engine of upgraded clang.

Also, this gives us a few advantages:
  * We can compare more precisely the source locations of diagnostics;
  * We can merge the code completion code path which works with file entries;
  * We can rely better when specifying //expected-note-s in different files.
2017-06-08 10:29:13 +02:00

27 lines
1.1 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 2>&1 | FileCheck %s
// Test the ability of unloading the last transaction. Here as a matter of fact
// we unload the wrapper as well and TODO: decrement the unique wrapper counter.
extern "C" int printf(const char* fmt, ...);
printf("Force printf codegeneration. Otherwise CG will defer it and .storeState will be unhappy.\n");
//CHECK: Force printf codegeneration. Otherwise CG will defer it and .storeState will be unhappy.
.storeState "preUnload"
int f = 0;
.undo
int f() {
printf("Now f is a function\n");
return 0;
} int a = f(); //CHECK: Now f is a function
.undo
.compareState "preUnload"
//CHECK-NOT: Differences
double f = 3.14
//CHECK: (double) 3.14