| 1 |
// UNSUPPORTED: system-aix |
| 2 |
// RUN: cat %s | clang-repl | FileCheck %s |
| 3 |
extern "C" int printf(const char *, ...); |
| 4 |
int x1 = 0; |
| 5 |
int x2 = 42; |
| 6 |
%undo |
| 7 |
int x2 = 24; |
| 8 |
auto r1 = printf("x1 = %d\n", x1); |
| 9 |
// CHECK: x1 = 0 |
| 10 |
auto r2 = printf("x2 = %d\n", x2); |
| 11 |
// CHECK-NEXT: x2 = 24 |
| 12 |
|
| 13 |
int foo() { return 1; } |
| 14 |
%undo |
| 15 |
int foo() { return 2; } |
| 16 |
auto r3 = printf("foo() = %d\n", foo()); |
| 17 |
// CHECK-NEXT: foo() = 2 |
| 18 |
|
| 19 |
inline int bar() { return 42;} |
| 20 |
auto r4 = bar(); |
| 21 |
%undo |
| 22 |
auto r5 = bar(); |
| 23 |
|
| 24 |
%quit |