|
7 | 7 | //------------------------------------------------------------------------------ |
8 | 8 |
|
9 | 9 | // RUN: cat %s | %cling -Xclang -verify 2>&1 | FileCheck %s |
10 | | -// Test undoPrinter |
| 10 | +// Test Check the ability to undo past runtime printing. |
| 11 | + |
| 12 | +// FIXME: |
| 13 | +// Unloading past first print Transaction can fail due to decl unloading. |
| 14 | +// Currently this test only validates that printing Transactions are properly |
| 15 | +// compressed/parented into one atomic undo-able Transaction. |
11 | 16 |
|
12 | 17 | .stats undo |
13 | 18 | // CHECK: <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
14 | 19 | // CHECK-NEXT: ` <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
15 | 20 |
|
16 | | -const char *message = "winkey"; |
17 | | - |
18 | | -message |
19 | | -// CHECK-NEXT: (const char *) "winkey" |
20 | | - |
21 | | -.undo |
22 | | - |
23 | | -// Make sure we can still print |
24 | | -message |
25 | | -// CHECK-NEXT: (const char *) "winkey" |
| 21 | +struct Trigger {}; |
| 22 | +Trigger T0 |
| 23 | +// CHECK-NEXT: (Trigger &) @0x{{[0-9a-f]+}} |
26 | 24 |
|
27 | | -.undo |
28 | 25 | .stats undo |
29 | 26 | // CHECK-NEXT: <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
30 | 27 | // CHECK-NEXT: ` <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
31 | 28 | // CHECK-NEXT: <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
32 | | - |
33 | | -message |
34 | | -// CHECK-NEXT: (const char *) "winkey" |
35 | | - |
36 | | -.undo // print message |
37 | | -.undo // decalre message |
38 | | -.stats undo |
39 | 29 | // CHECK-NEXT: <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
40 | 30 | // CHECK-NEXT: ` <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
| 31 | +// CHECK-NEXT: ` <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
| 32 | +// CHECK-NEXT: ` <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
41 | 33 |
|
42 | | -#include "cling/Interpreter/Interpreter.h" |
43 | | - |
44 | | -gCling->echo("1;"); |
45 | | -// CHECK-NEXT: (int) 1 |
46 | 34 |
|
| 35 | +Trigger T1 |
| 36 | +// CHECK-NEXT: (Trigger &) @0x{{[0-9a-f]+}} |
47 | 37 | .stats undo |
48 | 38 | // CHECK-NEXT: <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
49 | 39 | // CHECK-NEXT: ` <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
50 | 40 | // CHECK-NEXT: <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
51 | 41 | // CHECK-NEXT: <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
52 | 42 | // CHECK-NEXT: ` <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
53 | | -// CHECK-NEXT: ` <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
54 | | -// CHECK-NEXT: ` <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
55 | | -// CHECK-NEXT: ` <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
56 | | - |
57 | | -.undo |
58 | | -.stats undo |
59 | | -// CHECK-NEXT: <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
| 43 | +// CHECK-NEXT: ` <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
60 | 44 | // CHECK-NEXT: ` <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
61 | 45 | // CHECK-NEXT: <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
| 46 | +// CHECK-NEXT: ` <cling::Transaction* 0x{{[0-9a-f]+}} isEmpty=0 isCommitted=1> |
62 | 47 |
|
63 | | -gCling->echo("1;"); |
64 | | -// CHECK-NEXT: (int) 1 |
65 | 48 |
|
66 | 49 | // expected-no-diagnostics |
67 | 50 | .q |
0 commit comments