xref: /llvm-project/clang/test/Interpreter/execute.c (revision d999ce0302f06d250f6d496b56a5a5f2dc331e61)
1 // REQUIRES: host-supports-jit
2 // UNSUPPORTED: system-aix
3 
4 // RUN: cat %s | clang-repl -Xcc -xc -Xcc -Xclang -Xcc -verify | FileCheck %s
5 // RUN: cat %s | clang-repl -Xcc -xc -Xcc -O2 -Xcc -Xclang -Xcc -verify| FileCheck %s
6 int printf(const char *, ...);
7 int i = 42; err // expected-error{{use of undeclared identifier}}
8 int i = 42;
9 struct S { float f; struct S *m;} s = {1.0, 0};
10 // FIXME: Making foo inline fails to emit the function.
foo()11 int foo() { return 42; }
run()12 void run() {                                                    \
13   printf("i = %d\n", i);                                        \
14   printf("S[f=%f, m=0x%llx]\n", s.f, (unsigned long long)s.m);  \
15   int r3 = foo();                                               \
16 }
17 run();
18 // CHECK: i = 42
19 // CHECK-NEXT: S[f=1.000000, m=0x0]
20 
21 %quit
22