[cfe-commits] r68212 - /cfe/trunk/test/Sema/warn-missing-prototypes.c
Douglas Gregor
dgregor at apple.com
Wed Apr 1 09:38:49 PDT 2009
Author: dgregor
Date: Wed Apr 1 11:38:48 2009
New Revision: 68212
URL: http://llvm.org/viewvc/llvm-project?rev=68212&view=rev
Log:
Add testcase for -Wmissing-prototypes
Added:
cfe/trunk/test/Sema/warn-missing-prototypes.c (with props)
Added: cfe/trunk/test/Sema/warn-missing-prototypes.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-missing-prototypes.c?rev=68212&view=auto
==============================================================================
--- cfe/trunk/test/Sema/warn-missing-prototypes.c (added)
+++ cfe/trunk/test/Sema/warn-missing-prototypes.c Wed Apr 1 11:38:48 2009
@@ -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; }
Propchange: cfe/trunk/test/Sema/warn-missing-prototypes.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cfe/trunk/test/Sema/warn-missing-prototypes.c
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: cfe/trunk/test/Sema/warn-missing-prototypes.c
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the cfe-commits
mailing list