1ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
2ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao
3ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaochar *funk(int format);
4ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaoenum Test {A=-1};
5ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaochar *funk(enum Test x);
6ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao
7ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaoint eli(float b); // expected-note {{previous declaration is here}} \
8ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao// expected-note{{passing argument to parameter 'b' here}}
9ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaoint b(int c) {return 1;}
10ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao
11ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaoint foo();
12ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaoint foo() {
13ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  int eli(int (int)); // expected-error {{conflicting types for 'eli'}}
14ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  eli(b); // expected-error{{passing 'int (int)' to parameter of incompatible type 'float'}}
15ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  return 0;
16ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao}
17ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao
18ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaoint bar();
19ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaoint bar(int i) // expected-note {{previous definition is here}}
20ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao{
21ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  return 0;
22ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao}
23ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaoint bar() // expected-error {{redefinition of 'bar'}}
24ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao{
25ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  return 0;
26ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao}
27ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao
28ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaoint foobar(int); // note {{previous declaration is here}}
29ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaoint foobar() // error {{conflicting types for 'foobar'}}
30ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao{
31ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  return 0;
32ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao}
33ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao
34ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaoint wibble(); // expected-note {{previous declaration is here}}
35ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liaofloat wibble() // expected-error {{conflicting types for 'wibble'}}
36ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao{
37ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao  return 0.0f;
38ea285162342df160e7860e26528bc7110bc6c0cdShih-wei Liao}
39