Debian Codegraph @

clang/test/Interpreter/execute.cpp

raw
1 // clang-format off
2 // RUN: clang-repl "int i = 10;" 'extern "C" int printf(const char*,...);' \
3 // RUN: 'auto r1 = printf("i = %d\n", i);' | FileCheck --check-prefix=CHECK-DRIVER %s
4 // CHECK-DRIVER: i = 10
5
6 // RUN: cat %s | clang-repl | FileCheck %s
7 // RUN: cat %s | clang-repl -Xcc -O2 | FileCheck %s
8 // RUN: clang-repl -Xcc -include -Xcc %s | FileCheck %s
9 // RUN: clang-repl -Xcc -fsyntax-only -Xcc -include -Xcc %s
10 extern "C" int printf(const char *, ...);
11 int i = 42;
12 auto r1 = printf("i = %d\n", i);
13 // CHECK: i = 42
14
15 struct S { float f = 1.0; S *m = nullptr;} s;
16
17 auto r2 = printf("S[f=%f, m=0x%llx]\n", s.f, reinterpret_cast<unsigned long long>(s.m));
18 // CHECK-NEXT: S[f=1.000000, m=0x0]
19
20 inline int foo() { return 42; }
21 int r3 = foo();