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