Debian Codegraph @

clang/test/Interpreter/lambda.cpp

raw
1 // REQUIRES: host-supports-jit
2 // UNSUPPORTED: system-aix
3 // RUN: cat %s | clang-repl | FileCheck %s
4 // RUN: cat %s | clang-repl -Xcc -O2 | FileCheck %s
5 extern "C" int printf(const char *, ...);
6
7 auto l1 = []() { printf("ONE\n"); return 42; };
8 auto l2 = []() { printf("TWO\n"); return 17; };
9
10 auto r1 = l1();
11 // CHECK: ONE
12 auto r2 = l2();
13 // CHECK: TWO
14 auto r3 = l2();
15 // CHECK: TWO
16
17 %quit