[NFC][RISCV] Remove CFIIndex argument from allocateStack (#117871)
[llvm-project.git] / lldb / test / API / functionalities / conditional_break / main.c
blobdbfcefe802d2a2127c8912664ea4f7e5df312240
1 #include <stdio.h>
3 // This simple program is to demonstrate the capability of the lldb command
4 // "breakpoint command add" to add a set of commands to a breakpoint to be
5 // executed when the breakpoint is hit.
6 //
7 // In particular, we want to break within c(), but only if the immediate caller
8 // is a().
10 int a(int);
11 int b(int);
12 int c(int);
14 int a(int val)
16 if (val <= 1)
17 return b(val);
18 else if (val >= 3)
19 return c(val); // Find the line number where c's parent frame is a here.
21 return val;
24 int b(int val)
26 return c(val);
29 int c(int val)
31 return val + 3;
34 int main (int argc, char const *argv[])
36 int A1 = a(1); // a(1) -> b(1) -> c(1)
37 printf("a(1) returns %d\n", A1);
39 int B2 = b(2); // b(2) -> c(2)
40 printf("b(2) returns %d\n", B2);
42 int A3 = a(3); // a(3) -> c(3)
43 printf("a(3) returns %d\n", A3);
45 return 0;