xref: /llvm-project/clang/test/Interpreter/lambda.cpp (revision ac6e9e69bac76be2f05a20cea6ea8d69a0b43d1b)
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 
__anonf06837fa0102() 7 auto l1 = []() { printf("ONE\n"); return 42; };
__anonf06837fa0202() 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
18