1 /* Verify that we emit sane paths for state machine errors. */
2
3 #include <stdlib.h>
4
test_1(void)5 void test_1 (void)
6 {
7 void *ptr = malloc (1024); /* { dg-line malloc } */
8 free (ptr); /* { dg-line first_free } */
9 free (ptr); /* { dg-line second_free } */
10
11 /* { dg-warning "double-'free' of 'ptr'" "warning" { target *-*-* } second_free } */
12 /* { dg-message "\\(1\\) allocated here" "event 1" { target *-*-* } malloc } */
13 /* { dg-message "\\(2\\) first 'free' here" "event 2" { target *-*-* } first_free } */
14 /* { dg-message "\\(3\\) second 'free' here; first 'free' was at \\(2\\)" "event 3" { target *-*-* } second_free } */
15 }
16