2022-07-29 01:37:16 +08:00
|
|
|
// clang-format off
|
2022-06-24 15:17:20 +08:00
|
|
|
// RUN: clang-repl "int x = 10;" "int y=7; err;" "int y = 10;"
|
2021-07-11 01:50:41 +08:00
|
|
|
// RUN: clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);' \
|
|
|
|
// RUN: 'auto r1 = printf("i = %d\n", i);' | FileCheck --check-prefix=CHECK-DRIVER %s
|
2021-05-16 10:38:42 +08:00
|
|
|
// UNSUPPORTED: system-aix
|
2021-07-11 01:50:41 +08:00
|
|
|
// CHECK-DRIVER: i = 10
|
|
|
|
// RUN: cat %s | clang-repl | FileCheck %s
|
2022-07-23 13:55:10 +08:00
|
|
|
// RUN: cat %s | clang-repl -Xcc -O2 | FileCheck %s
|
2021-05-13 13:41:44 +08:00
|
|
|
extern "C" int printf(const char *, ...);
|
|
|
|
int i = 42;
|
|
|
|
auto r1 = printf("i = %d\n", i);
|
|
|
|
// CHECK: i = 42
|
|
|
|
|
|
|
|
struct S { float f = 1.0; S *m = nullptr;} s;
|
|
|
|
|
|
|
|
auto r2 = printf("S[f=%f, m=0x%llx]\n", s.f, reinterpret_cast<unsigned long long>(s.m));
|
|
|
|
// CHECK-NEXT: S[f=1.000000, m=0x0]
|
2022-06-18 19:53:11 +08:00
|
|
|
|
|
|
|
inline int foo() { return 42; }
|
|
|
|
int r3 = foo();
|
|
|
|
|
2022-06-19 10:39:03 +08:00
|
|
|
%quit
|