1 //===-- main.c --------------------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 #include <stdio.h>
9 
10 // This simple program is to test the lldb Python API related to events.
11 
12 int a(int);
13 int b(int);
14 int c(int);
15 
a(int val)16 int a(int val)
17 {
18     if (val <= 1)
19         return b(val);
20     else if (val >= 3)
21         return c(val);
22 
23     return val;
24 }
25 
b(int val)26 int b(int val)
27 {
28     return c(val);
29 }
30 
c(int val)31 int c(int val)
32 {
33     return val + 3; // Find the line number of function "c" here.
34 }
35 
main(int argc,char const * argv[])36 int main (int argc, char const *argv[])
37 {
38     int A1 = a(1);  // a(1) -> b(1) -> c(1)
39     printf("a(1) returns %d\n", A1);
40 
41     int B2 = b(2);  // b(2) -> c(2)
42     printf("b(2) returns %d\n", B2);
43 
44     int A3 = a(3);  // a(3) -> c(3)
45     printf("a(3) returns %d\n", A3);
46 
47     return 0;
48 }
49