summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/noncompile/scope.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/noncompile/scope.c')
-rw-r--r--gcc/testsuite/gcc.dg/noncompile/scope.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/noncompile/scope.c b/gcc/testsuite/gcc.dg/noncompile/scope.c
new file mode 100644
index 000000000..7f09c27cf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/noncompile/scope.c
@@ -0,0 +1,19 @@
+extern void abort (void);
+extern void exit (int);
+static int v = 3;
+
+f ()
+{
+ int v = 4;
+ {
+ extern int v; /* { dg-error "static" } */
+ if (v != 3)
+ abort ();
+ }
+}
+
+main ()
+{
+ f ();
+ exit (0);
+}