summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/special/20000419-2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/special/20000419-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/special/20000419-2.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/special/20000419-2.c b/gcc/testsuite/gcc.dg/special/20000419-2.c
new file mode 100644
index 000000000..4a228eb1a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/special/20000419-2.c
@@ -0,0 +1,18 @@
+/* A static function with a global alias should not get 'defined but
+ not used' warnings. Exposed by Linux kernel. */
+/* { dg-do compile } */
+/* { dg-require-alias "" } */
+/* { dg-options "-Wall" } */
+
+extern void do_something (void);
+extern void do_something_else (void);
+
+static int
+init_foobar(void) /* { dg-bogus "defined but not used" "not used warning" } */
+{
+ do_something();
+ do_something_else();
+ return 0;
+}
+
+int init_module(void) __attribute__((alias("init_foobar")));