ppc64: Arguments to iselInt128Expr_to_32x4 should be initialized.
[valgrind.git] / memcheck / tests / solaris / inlinfo_nested.c
blob38a65806142603399f5bdbadccff2530c76a03bc
1 /* Taken from memcheck/tests/inlinfo.c almost verbatim;
2 * only main() renamed to main_nested().
3 */
5 #include "../../memcheck.h"
6 #define INLINE static inline __attribute__((always_inline))
8 INLINE int fun_d(int argd) {
9 static int locd = 0;
10 if (argd > 0)
11 locd += argd;
12 return locd;
15 INLINE int fun_c(int argc) {
16 static int locc = 0;
17 locc += argc;
18 return fun_d(locc);
21 INLINE int fun_b(int argb) {
22 static int locb = 0;
23 locb += argb;
24 return fun_c(locb);
27 INLINE int fun_a(int arga) {
28 static int loca = 0;
29 loca += arga;
30 return fun_b(loca);
33 __attribute__((noinline))
34 static int fun_noninline_m(int argm)
36 return fun_d(argm);
39 __attribute__((noinline))
40 static int fun_noninline_o(int argo)
42 static int loco = 0;
43 if (argo > 0)
44 loco += argo;
45 return loco;
48 INLINE int fun_f(int argf) {
49 static int locf = 0;
50 locf += argf;
51 return fun_noninline_o(locf);
54 INLINE int fun_e(int arge) {
55 static int loce = 0;
56 loce += arge;
57 return fun_f(loce);
60 __attribute__((noinline))
61 static int fun_noninline_n(int argn)
63 return fun_e(argn);
67 int main_nested(void) {
68 int result;
69 result = fun_a(result);
70 VALGRIND_MAKE_MEM_UNDEFINED(&result, sizeof(result));
71 result += fun_noninline_m(result);
72 VALGRIND_MAKE_MEM_UNDEFINED(&result, sizeof(result));
73 result += fun_d(result);
74 VALGRIND_MAKE_MEM_UNDEFINED(&result, sizeof(result));
75 result += fun_noninline_n(result);
76 return 0;