1 //===-- main.cpp --------------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 int foo(int x, int y) {
19 int add_num(int i) const { return i + 3 ; }
21 std::function<int (int)> add_num2_f = [](int x) {
25 return add_num2_f(i); // Set break point at this line.
34 std::function<int (int)> foo2_f = f;
36 return foo2_f(10); // Set break point at this line.
39 int main (int argc, char *argv[])
42 std::function<int (int,int)> f1 = foo;
43 std::function<int (int)> f2 = [acc,f1] (int x) -> int {
47 auto f = [](int x, int y) { return x + y; };
48 auto g = [](int x, int y) { return x * y; } ;
49 std::function<int (int,int)> f3 = argc %2 ? f : g ;
52 std::function<int ()> f4( bar1 ) ;
53 std::function<int (const Bar&, int)> f5 = &Bar::add_num;
55 int foo2_result = foo2();
56 int bar_add_num2_result = bar1.add_num2(10);
58 return f1(acc,acc) + f2(acc) + f3(acc+1,acc+2) + f4() + f5(bar1, 10); // Set break point at this line.