memcheck: on arm64, use expensive instrumentation for Cmp{EQ,NE}64 by default.
[valgrind.git] / memcheck / tests / inlinfo.c
blobc0d72ce85dc823964a869c0f4467836c6b542770
1 #include <stdio.h>
2 #include "../memcheck.h"
3 #define INLINE inline __attribute__((always_inline))
5 INLINE int fun_d(int argd) {
6 static int locd = 0;
7 if (argd > 0)
8 locd += argd;
9 return locd;
12 INLINE int fun_c(int argc) {
13 static int locc = 0;
14 locc += argc;
15 return fun_d(locc);
18 INLINE int fun_b(int argb) {
19 static int locb = 0;
20 locb += argb;
21 return fun_c(locb);
24 INLINE int fun_a(int arga) {
25 static int loca = 0;
26 loca += arga;
27 return fun_b(loca);
30 __attribute__((noinline))
31 static int fun_noninline_m(int argm)
33 return fun_d(argm);
36 __attribute__((noinline))
37 static int fun_noninline_o(int argo)
39 static int loco = 0;
40 if (argo > 0)
41 loco += argo;
42 return loco;
45 INLINE int fun_f(int argf) {
46 static int locf = 0;
47 locf += argf;
48 return fun_noninline_o(locf);
51 INLINE int fun_e(int arge) {
52 static int loce = 0;
53 loce += arge;
54 return fun_f(loce);
57 __attribute__((noinline))
58 static int fun_noninline_n(int argn)
60 return fun_e(argn);
64 int main() {
65 int result;
66 result = fun_a(result);
67 VALGRIND_MAKE_MEM_UNDEFINED(&result, sizeof(result));
68 result += fun_noninline_m(result);
69 VALGRIND_MAKE_MEM_UNDEFINED(&result, sizeof(result));
70 result += fun_d(result);
71 VALGRIND_MAKE_MEM_UNDEFINED(&result, sizeof(result));
72 result += fun_noninline_n(result);
73 return 0;