1 /* { dg-do run { target *-*-linux* *-*-gnu* } } */
2 /* { dg-options "-fprofile-arcs -fprofile-info-section" } */
7 : (__builtin_printf ("%s:%i: Assertion `%s' failed.\n", \
8 __FILE__, __LINE__, #expr), \
14 __gcov_info_to_gcda (const struct gcov_info
*__info
,
15 void (*__filename_fn
) (const char *, void *),
16 void (*__dump_fn
) (const void *, unsigned, void *),
17 void *(*__allocate_fn
) (unsigned, void *),
21 __gcov_filename_to_gcfn (const char *__filename
,
22 void (*__dump_fn
) (const void *, unsigned, void *),
25 extern const struct gcov_info
*my_info
;
27 static unsigned counter
;
29 static unsigned counter_after_filename
;
31 static int check_zero
;
33 static int check_after_filename
;
36 dump (const void *d
, unsigned n
, void *arg
)
38 unsigned *m
= (unsigned *)arg
;
39 assert (arg
== &counter
);
43 const unsigned *u
= d
;
44 assert (*u
== 0x6763666e);
47 else if (*m
== counter_after_filename
)
49 const unsigned *u
= d
;
50 assert (*u
== 0x67636461);
51 check_after_filename
= 1;
58 filename (const char *f
, void *arg
)
60 assert (arg
== &counter
);
61 assert (__builtin_strstr (f
, "gcov-info-to-gcda.c") == 0);
62 __gcov_filename_to_gcfn (f
, dump
, arg
);
63 counter_after_filename
= counter
;
67 allocate (unsigned length
, void *arg
)
69 assert (arg
== &counter
);
70 return __builtin_malloc (length
);
75 __asm__
volatile (".set my_info, .LPBX2");
76 __gcov_info_to_gcda (my_info
, filename
, dump
, allocate
, &counter
);
79 assert (check_after_filename
);