blob: 1dcd1d38a28c29397553e12b0b6582ff8d60c7e7 [file] [log] [blame]
Chris Lattner55196442007-11-20 19:04:50 +00001// RUN: clang -fsyntax-only -verify -pedantic %s
Steve Naroff4a746782008-01-09 22:43:08 +00002
3char *funk(int format);
4enum Test {A=-1};
5char *funk(enum Test x);
6
Steve Naroff837618c2008-01-16 15:01:34 +00007int eli(float b); // expected-error {{previous declaration is here}}
Steve Naroffffce4d52008-01-09 23:34:55 +00008int b(int c) {return 1;}
9
Chris Lattner55196442007-11-20 19:04:50 +000010int foo();
11int foo()
12{
Steve Naroff837618c2008-01-16 15:01:34 +000013 int eli(int (int)); // expected-error {{conflicting types for 'eli'}}
Steve Naroffffce4d52008-01-09 23:34:55 +000014 eli(b);
Chris Lattner55196442007-11-20 19:04:50 +000015 return 0;
16}
17
18int bar();
19int bar(int i) // expected-error {{previous definition is here}}
20{
21 return 0;
22}
Steve Naroff837618c2008-01-16 15:01:34 +000023int bar() // expected-error {{redefinition of 'bar'}} expected-error {{conflicting types for 'bar'}}
Chris Lattner55196442007-11-20 19:04:50 +000024{
25 return 0;
26}
27
Steve Naroff837618c2008-01-16 15:01:34 +000028int foobar(int); // expected-error {{previous declaration is here}}
29int foobar() // expected-error {{conflicting types for 'foobar'}}
Chris Lattner55196442007-11-20 19:04:50 +000030{
31 return 0;
32}
33
Steve Naroff837618c2008-01-16 15:01:34 +000034int wibble(); // expected-error {{previous declaration is here}}
35float wibble() // expected-error {{conflicting types for 'wibble'}}
Chris Lattner55196442007-11-20 19:04:50 +000036{
37 return 0.0f;
38}