diff options
author | Joseph Myers <joseph@codesourcery.com> | 2004-11-01 19:49:55 +0000 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2004-11-01 19:49:55 +0000 |
commit | ee0602299c6e6e70f24adb7983137786f227c70c (patch) | |
tree | 807c495bb9e4d5a1fe92f0997159322a7f1f95a3 /gcc/testsuite | |
parent | 40d05429503044c2cd3d10317ae1cff1b06d21ce (diff) | |
download | gcc-ee0602299c6e6e70f24adb7983137786f227c70c.zip gcc-ee0602299c6e6e70f24adb7983137786f227c70c.tar.gz gcc-ee0602299c6e6e70f24adb7983137786f227c70c.tar.bz2 |
re PR c/18239 (ICE in get_parm_info with werid attribute)
PR c/18239
* c-decl.c (get_parm_info): Allow FUNCTION_DECLs to appear amongst
parameter declarations.
testsuite:
* gcc.dg/parm-impl-decl-1.c, gcc.dg/parm-impl-decl-2.c: New tests.
From-SVN: r89956
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/parm-impl-decl-1.c | 33 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/parm-impl-decl-2.c | 7 |
3 files changed, 45 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3b08af5..b4746bc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-11-01 Joseph S. Myers <joseph@codesourcery.com> + + PR c/18239 + * gcc.dg/parm-impl-decl-1.c, gcc.dg/parm-impl-decl-2.c: New tests. + 2004-11-01 Nathan Sidwell <nathan@codesourcery.com> PR c++/18064 diff --git a/gcc/testsuite/gcc.dg/parm-impl-decl-1.c b/gcc/testsuite/gcc.dg/parm-impl-decl-1.c new file mode 100644 index 0000000..1e45d3b --- /dev/null +++ b/gcc/testsuite/gcc.dg/parm-impl-decl-1.c @@ -0,0 +1,33 @@ +/* Test implicit function declarations and other odd declarations in + function prototypes. Bug 18239. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +/* Implicit function declaration in attribute in definition (testcase + from bug). */ +int +foo (int __attribute__ ((__mode__ (vector_size(8)))) i) /* { dg-warning "warning: '__mode__' attribute ignored" } */ +{ + return (long long) i; +} + +/* Various other cases. */ + +int f (int [sizeof(g())]); +int f1 (int [sizeof(g1())]); + +int g () { return 1; } + +int +h (int (*p)[sizeof(i())]) +{ + int g2 (), g3 (); + return (*p)[0] + g3() + g2(); +} + +int i () { return 2; } + +int f2 (int [sizeof(g2())]); +int f3 (int [sizeof(g3())]); +int g3 () { return 4; } diff --git a/gcc/testsuite/gcc.dg/parm-impl-decl-2.c b/gcc/testsuite/gcc.dg/parm-impl-decl-2.c new file mode 100644 index 0000000..1f46300 --- /dev/null +++ b/gcc/testsuite/gcc.dg/parm-impl-decl-2.c @@ -0,0 +1,7 @@ +/* Test implicit function declarations and other odd declarations in + function prototypes. Make sure that LABEL_DECLs don't occur. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +int k (int [sizeof &&z]); /* { dg-error "error: label 'z' referenced outside of any function" } */ |