2 /* Origin: David Hollenberg <dhollen@mosis.org> */
4 /* Verify that the compiler doesn't inline a function at
5 a calling point where it is viewed with a different
6 prototype than the actual one. */
8 /* { dg-do compile } */
9 /* { dg-options "-O3" } */
25 d
= ((double (*) (int)) foo1
) (i
); /* { dg-warning "non-compatible|abort" } */
26 i
= ((int (*) (double)) foo1
) (d
); /* { dg-warning "non-compatible|abort" } */
27 s
= ((str_t (*) (int)) foo1
) (i
); /* { dg-warning "non-compatible|abort" } */
28 ((void (*) (int)) foo1
) (d
); /* { dg-warning "non-compatible|abort" } */
29 i
= ((int (*) (int)) foo1
) (i
); /* { dg-bogus "non-compatible|abort" } */
30 (void) foo1 (i
); /* { dg-bogus "non-compatible|abort" } */
32 d
= ((double (*) (int)) foo2
) (i
); /* { dg-warning "non-compatible|abort" } */
33 i
= ((int (*) (double)) foo2
) (d
); /* { dg-bogus "non-compatible|abort" } */
34 s
= ((str_t (*) (int)) foo2
) (i
); /* { dg-warning "non-compatible|abort" } */
35 ((void (*) (int)) foo2
) (d
); /* { dg-warning "non-compatible|abort" } */
36 i
= ((int (*) (int)) foo2
) (i
); /* { dg-bogus "non-compatible|abort" } */
37 (void) foo2 (i
); /* { dg-bogus "non-compatible|abort" } */