• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang -Wmissing-prototypes -fsyntax-only -Xclang -verify %s
2 
3 int f();
4 
f(int x)5 int f(int x) { return x; } // expected-warning{{no previous prototype for function 'f'}}
6 
g(int x)7 static int g(int x) { return x; }
8 
h(int x)9 int h(int x) { return x; } // expected-warning{{no previous prototype for function 'h'}}
10 
11 static int g2();
12 
g2(int x)13 int g2(int x) { return x; }
14 
15 void test(void);
16 
17 int h3();
18 int h4(int);
19 int h4();
20 
test(void)21 void test(void) {
22   int h2(int x);
23   int h3(int x);
24   int h4();
25 }
26 
h2(int x)27 int h2(int x) { return x; } // expected-warning{{no previous prototype for function 'h2'}}
h3(int x)28 int h3(int x) { return x; } // expected-warning{{no previous prototype for function 'h3'}}
h4(int x)29 int h4(int x) { return x; }
30 
31 int f2(int);
32 int f2();
33 
f2(int x)34 int f2(int x) { return x; }
35 
36 // rdar://6759522
main(void)37 int main(void) { return 0; }
38