diff options
Diffstat (limited to 'gcc/testsuite/c-c++-common/Wunused-var-5.c')
-rw-r--r-- | gcc/testsuite/c-c++-common/Wunused-var-5.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/Wunused-var-5.c b/gcc/testsuite/c-c++-common/Wunused-var-5.c new file mode 100644 index 000000000..747f58d04 --- /dev/null +++ b/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; +} |