diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/pr56724-1.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/pr56724-1.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/pr56724-1.c b/gcc-4.9/gcc/testsuite/gcc.dg/pr56724-1.c new file mode 100644 index 000000000..4276c3f15 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/pr56724-1.c @@ -0,0 +1,33 @@ +/* PR c/56724 */ +/* { dg-do compile } */ +/* { dg-options "-Wtraditional-conversion" } */ + +extern void foo (int p[2][]); /* { dg-error "array type has incomplete element type" } */ +extern void foo_i (int, int); +extern void foo_u (unsigned int); +extern void foo_f (int, float); +extern void foo_ll (long long); +extern void foo_cd (int, int, __complex__ double); +extern signed char sc; +extern int i; +extern unsigned int u; +extern float f; +extern double d; +extern __complex__ double cd; + +void +fn () +{ + int p[1][1]; + foo (p); /* { dg-error "8:type of formal parameter" } */ + foo_i (1, f); /* { dg-warning "13:passing argument" } */ + foo_i (1, cd); /* { dg-warning "13:passing argument" } */ + foo_cd (1, 2, f); /* { dg-warning "17:passing argument" } */ + foo_f (9, i); /* { dg-warning "13:passing argument" } */ + foo_cd (2, 2, i); /* { dg-warning "17:passing argument" } */ + foo_f (2, cd); /* { dg-warning "13:passing argument" } */ + foo_f (2, d); /* { dg-warning "13:passing argument" } */ + foo_ll (sc); /* { dg-warning "11:passing argument" } */ + foo_u (i); /* { dg-warning "10:passing argument" } */ + foo_i (1, u); /* { dg-warning "13:passing argument" } */ +} |