aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/parm-impl-decl-3.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2010-03-26 23:52:09 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2010-03-26 23:52:09 +0000
commit10e76c1a45d1efa0f4637ec4bb09fbc6005ed3fd (patch)
tree8dd23f7d006e9f449c212ce5cea214baccf360b6 /gcc/testsuite/gcc.dg/parm-impl-decl-3.c
parentc6cc83d0c956ff38234275106c582edac67d3e39 (diff)
downloadgcc-10e76c1a45d1efa0f4637ec4bb09fbc6005ed3fd.zip
gcc-10e76c1a45d1efa0f4637ec4bb09fbc6005ed3fd.tar.gz
gcc-10e76c1a45d1efa0f4637ec4bb09fbc6005ed3fd.tar.bz2
re PR c/43381 (infinite loop in gcc.dg/parm-impl-decl-1.c with -g)
PR c/43381 * c-decl.c (get_parm_info): Assert that decl going in OTHERS has a nested binding iff it is a FUNCTION_DECL. (store_parm_decls_newstyle): Pass nested=true to bind for FUNCTION_DECLs amongst parameters. testsuite: * gcc.dg/parm-impl-decl-3.c: New test. From-SVN: r157766
Diffstat (limited to 'gcc/testsuite/gcc.dg/parm-impl-decl-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/parm-impl-decl-3.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/parm-impl-decl-3.c b/gcc/testsuite/gcc.dg/parm-impl-decl-3.c
new file mode 100644
index 0000000..b3941b9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/parm-impl-decl-3.c
@@ -0,0 +1,28 @@
+/* Like parm-impl-decl-1.c, but with -g. PR 43381. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-g" } */
+
+int
+foo (int __attribute__ ((__mode__ (vector_size(8)))) i) /* { dg-warning "'__mode__' attribute ignored" } */
+{
+ return (long long) i;
+}
+
+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; }