blob: bce63550ccbdd5a363ad9c6026184d8e9b72862a [file] [log] [blame]
Chris Lattner60476ff2007-11-20 19:04:50 +00001// RUN: clang -fsyntax-only -verify -pedantic %s
Steve Naroffc88babe2008-01-09 22:43:08 +00002
3char *funk(int format);
4enum Test {A=-1};
5char *funk(enum Test x);
6
Chris Lattner1336cab2008-11-23 23:12:31 +00007int eli(float b); // expected-note {{previous declaration is here}}
Steve Narofff8a09432008-01-09 23:34:55 +00008int b(int c) {return 1;}
9
Chris Lattner60476ff2007-11-20 19:04:50 +000010int foo();
11int foo()
12{
Steve Naroff6c9e7922008-01-16 15:01:34 +000013 int eli(int (int)); // expected-error {{conflicting types for 'eli'}}
Douglas Gregor083c23e2009-02-16 17:45:42 +000014 eli(b); // expected-error{{incompatible type passing}}
Chris Lattner60476ff2007-11-20 19:04:50 +000015 return 0;
16}
17
18int bar();
Chris Lattner1336cab2008-11-23 23:12:31 +000019int bar(int i) // expected-note {{previous definition is here}}
Chris Lattner60476ff2007-11-20 19:04:50 +000020{
21 return 0;
22}
Chris Lattnerec9361f2008-02-17 19:31:09 +000023int bar() // expected-error {{redefinition of 'bar'}}
Chris Lattner60476ff2007-11-20 19:04:50 +000024{
25 return 0;
26}
27
Chris Lattner1336cab2008-11-23 23:12:31 +000028int foobar(int); // note {{previous declaration is here}}
Chris Lattner4f5f04a2008-11-21 01:05:35 +000029int foobar() // error {{conflicting types for 'foobar'}}
Chris Lattner60476ff2007-11-20 19:04:50 +000030{
31 return 0;
32}
33
Chris Lattner1336cab2008-11-23 23:12:31 +000034int wibble(); // expected-note {{previous declaration is here}}
Steve Naroff6c9e7922008-01-16 15:01:34 +000035float wibble() // expected-error {{conflicting types for 'wibble'}}
Chris Lattner60476ff2007-11-20 19:04:50 +000036{
37 return 0.0f;
38}