summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/unused-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/unused-3.c')
-rw-r--r--gcc/testsuite/gcc.dg/unused-3.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/unused-3.c b/gcc/testsuite/gcc.dg/unused-3.c
new file mode 100644
index 000000000..120562448
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/unused-3.c
@@ -0,0 +1,14 @@
+/* Copyright (C) 2000 Free Software Foundation. */
+/* Added extra line-breaks to check that diagnostics refer to correct token.
+ --Per Bothner. */
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+typedef short unused_type __attribute__ ((unused));
+main ()
+{
+ short
+ x /* { dg-warning "unused variable" "unused variable warning" } */
+ ;
+ unused_type y;
+}