Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / lang / cpp / inlines / inlines.cpp
blob822d88e22f9bcce8ba72b7da8bdf6728669316e9
1 #include <stdio.h>
2 #include "inlines.h"
4 #define INLINE_ME __inline__ __attribute__((always_inline))
6 int
7 not_inlined_2 (int input)
9 printf ("Called in not_inlined_2 with : %d.\n", input);
10 return input;
13 int
14 not_inlined_1 (int input)
16 printf ("Called in not_inlined_1 with %d.\n", input);
17 return not_inlined_2(input);
20 INLINE_ME int
21 inner_inline (int inner_input, int mod_value)
23 int inner_result;
24 inner_result = inner_input % mod_value;
25 printf ("Returning: %d.\n", inner_result);
26 return not_inlined_1 (inner_result); // Set break point at this line.
29 INLINE_ME int
30 outer_inline (int outer_input)
32 int outer_result;
34 outer_result = inner_inline (outer_input, outer_input % 3);
35 return outer_result;
38 int
39 main (int argc, char **argv)
41 printf ("Starting...\n");
43 int (*func_ptr) (int);
44 func_ptr = outer_inline;
46 outer_inline (argc);
48 func_ptr (argc);
50 return 0;