diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/20041213-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/20041213-1.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20041213-1.c b/gcc/testsuite/gcc.dg/20041213-1.c new file mode 100644 index 00000000000..99027371447 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20041213-1.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* test redeclarations with void and implicit int */ +extern foo1(); /* { dg-error "error: previous declaration" } */ +extern void foo1(); /* { dg-error "error: conflicting types" } */ + +extern void foo2(); /* { dg-error "error: previous declaration" } */ +extern foo2(); /* { dg-error "error: conflicting types" } */ + +void foo3() {} /* { dg-error "error: previous definition" } */ +extern foo3(); /* { dg-error "error: conflicting types" } */ + +extern foo4(); /* { dg-error "error: previous declaration" } */ +void foo4() {} /* { dg-error "error: conflicting types" } */ + +extern void foo5(); /* { dg-warning "previous declaration" } */ +foo5() {} /* { dg-warning "conflicting types" } */ + +foo6() {} /* { dg-error "error: previous definition" } */ +extern void foo6(); /* { dg-error "error: conflicting types" } */ + +foo7() {} /* { dg-error "error: previous definition" } */ +void foo7() {} /* { dg-error "error: conflicting types" } */ + +void foo8() {} /* { dg-error "error: previous definition" } */ +foo8() {} /* { dg-error "error: conflicting types" } */ + +int use9() { foo9(); } /* { dg-warning "previous implicit declaration" } */ +extern void foo9(); /* { dg-warning "conflicting types" } */ + +int use10() { foo10(); } /* { dg-warning "previous implicit declaration" } */ +void foo10() {} /* { dg-warning "conflicting types" } */ + |