aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wnested-externs-1.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2004-11-29 11:35:34 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2004-11-29 11:35:34 +0000
commit1cb1fa517f041e44898d1abe4293bb367c30ae95 (patch)
tree90e4515759bd82802db7b8d774b90f54139c454a /gcc/testsuite/gcc.dg/Wnested-externs-1.c
parente13971e036199cf5f581ca31b43567b9b5aeab34 (diff)
downloadgcc-1cb1fa517f041e44898d1abe4293bb367c30ae95.zip
gcc-1cb1fa517f041e44898d1abe4293bb367c30ae95.tar.gz
gcc-1cb1fa517f041e44898d1abe4293bb367c30ae95.tar.bz2
Wnested-externs-1.c, [...]: New tests.
* gcc.dg/Wnested-externs-1.c, gcc.dg/decl-7.c, gcc.dg/decl-8.c, gcc.dg/if-empty-1.c, gcc.dg/init-bad-1.c, gcc.dg/init-bad-2.c, gcc.dg/init-bad-3.c, gcc.dg/parm-mismatch-1.c: New tests. From-SVN: r91465
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wnested-externs-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/Wnested-externs-1.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wnested-externs-1.c b/gcc/testsuite/gcc.dg/Wnested-externs-1.c
new file mode 100644
index 0000000..2d854a8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wnested-externs-1.c
@@ -0,0 +1,22 @@
+/* Test -Wnested-externs. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-Wnested-externs" } */
+
+int a;
+static int b;
+extern int c;
+void f0(void);
+static void f1(void);
+
+void
+g(void)
+{
+ extern int a; /* { dg-warning "warning: nested extern declaration of 'a'" } */
+ extern int b; /* { dg-warning "warning: nested extern declaration of 'b'" } */
+ extern int c; /* { dg-warning "warning: nested extern declaration of 'c'" } */
+ extern int d; /* { dg-warning "warning: nested extern declaration of 'd'" } */
+ extern void f0(void); /* { dg-warning "warning: nested extern declaration of 'f0'" } */
+ extern void f1(void); /* { dg-warning "warning: nested extern declaration of 'f1'" } */
+ extern void f2(void); /* { dg-warning "warning: nested extern declaration of 'f2'" } */
+}