aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/Wunused-var-5.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/Wunused-var-5.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/Wunused-var-5.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/Wunused-var-5.c b/gcc-4.9/gcc/testsuite/c-c++-common/Wunused-var-5.c
new file mode 100644
index 000000000..747f58d04
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/Wunused-var-5.c
@@ -0,0 +1,33 @@
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+void
+f1 (void)
+{
+ extern int extvari;
+ extvari = 1;
+}
+
+int extvarj;
+
+void
+f2 (void)
+{
+ extern int extvarj;
+ extvarj = 1;
+}
+
+static int extvark;
+
+void
+f3 (void)
+{
+ extern int extvark;
+ extvark = 1;
+}
+
+int
+f4 (void)
+{
+ return extvark;
+}