]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/python_api/event/main.c
Vendor import of lldb trunk r256945:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / python_api / event / main.c
1 //===-- main.c --------------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 #include <stdio.h>
10
11 // This simple program is to test the lldb Python API related to events.
12
13 int a(int);
14 int b(int);
15 int c(int);
16
17 int a(int val)
18 {
19     if (val <= 1)
20         return b(val);
21     else if (val >= 3)
22         return c(val);
23
24     return val;
25 }
26
27 int b(int val)
28 {
29     return c(val);
30 }
31
32 int c(int val)
33 {
34     return val + 3; // Find the line number of function "c" here.
35 }
36
37 int main (int argc, char const *argv[])
38 {
39     int A1 = a(1);  // a(1) -> b(1) -> c(1)
40     printf("a(1) returns %d\n", A1);
41     
42     int B2 = b(2);  // b(2) -> c(2)
43     printf("b(2) returns %d\n", B2);
44     
45     int A3 = a(3);  // a(3) -> c(3)
46     printf("a(3) returns %d\n", A3);
47     
48     return 0;
49 }