Daniel Dunbar | 80737ad | 2009-12-15 22:01:24 +0000 | [diff] [blame] | 1 | // RUN: %clang -Wmissing-prototypes -fsyntax-only -Xclang -verify %s |
Douglas Gregor | 4eee274 | 2009-04-01 16:38:48 +0000 | [diff] [blame] | 2 | |
| 3 | int f(); |
| 4 | |
| 5 | int f(int x) { return x; } // expected-warning{{no previous prototype for function 'f'}} |
| 6 | |
| 7 | static int g(int x) { return x; } |
| 8 | |
| 9 | int h(int x) { return x; } // expected-warning{{no previous prototype for function 'h'}} |
| 10 | |
| 11 | static int g2(); |
| 12 | |
| 13 | int g2(int x) { return x; } |
| 14 | |
| 15 | void test(void); |
| 16 | |
| 17 | int h3(); |
| 18 | int h4(int); |
| 19 | int h4(); |
| 20 | |
| 21 | void test(void) { |
| 22 | int h2(int x); |
| 23 | int h3(int x); |
| 24 | int h4(); |
| 25 | } |
| 26 | |
| 27 | int h2(int x) { return x; } // expected-warning{{no previous prototype for function 'h2'}} |
| 28 | int h3(int x) { return x; } // expected-warning{{no previous prototype for function 'h3'}} |
| 29 | int h4(int x) { return x; } |
| 30 | |
| 31 | int f2(int); |
| 32 | int f2(); |
| 33 | |
| 34 | int f2(int x) { return x; } |
Douglas Gregor | 2c2d9dc | 2009-04-08 15:21:36 +0000 | [diff] [blame] | 35 | |
Chris Lattner | 73f35e6 | 2009-04-11 17:26:58 +0000 | [diff] [blame] | 36 | // rdar://6759522 |
Douglas Gregor | 2c2d9dc | 2009-04-08 15:21:36 +0000 | [diff] [blame] | 37 | int main(void) { return 0; } |