From: Douglas Gregor Date: Wed, 1 Apr 2009 16:38:48 +0000 (+0000) Subject: Add testcase for -Wmissing-prototypes X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4eee2742c37abb44782c15acd072f8aa1717e036;p=clang Add testcase for -Wmissing-prototypes git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68212 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Sema/warn-missing-prototypes.c b/test/Sema/warn-missing-prototypes.c new file mode 100644 index 0000000000..20c28d061c --- /dev/null +++ b/test/Sema/warn-missing-prototypes.c @@ -0,0 +1,34 @@ +// RUN: clang -Wmissing-prototypes -fsyntax-only -Xclang -verify %s + +int f(); + +int f(int x) { return x; } // expected-warning{{no previous prototype for function 'f'}} + +static int g(int x) { return x; } + +int h(int x) { return x; } // expected-warning{{no previous prototype for function 'h'}} + +static int g2(); + +int g2(int x) { return x; } + +void test(void); + +int h3(); +int h4(int); +int h4(); + +void test(void) { + int h2(int x); + int h3(int x); + int h4(); +} + +int h2(int x) { return x; } // expected-warning{{no previous prototype for function 'h2'}} +int h3(int x) { return x; } // expected-warning{{no previous prototype for function 'h3'}} +int h4(int x) { return x; } + +int f2(int); +int f2(); + +int f2(int x) { return x; }