blob: 468f3f61428f1623a699d92649995e82cc003e7e [file] [log] [blame]
Chris Lattner1470b072007-11-06 06:07:26 +00001// RUN: clang %s -verify -fsyntax-only
2
3void foo(void);
Steve Naroff1d5bd642008-01-14 20:51:29 +00004void foo(void) {}
Chris Lattner1470b072007-11-06 06:07:26 +00005void foo(void);
Chris Lattner1336cab2008-11-23 23:12:31 +00006void foo(void); // expected-note {{previous declaration is here}}
Chris Lattner1470b072007-11-06 06:07:26 +00007
Steve Naroff6c9e7922008-01-16 15:01:34 +00008void foo(int); // expected-error {{conflicting types for 'foo'}}
Steve Naroff1d5bd642008-01-14 20:51:29 +00009
10int funcdef()
11{
12 return 0;
13}
14
15int funcdef();
16
Chris Lattner1336cab2008-11-23 23:12:31 +000017int funcdef2() { return 0; } // expected-note {{previous definition is here}}
Steve Naroff1d5bd642008-01-14 20:51:29 +000018int funcdef2() { return 0; } // expected-error {{redefinition of 'funcdef2'}}
19
Nuno Lopese1726fd2009-01-28 00:44:33 +000020// PR2502
21void (*f)(void);
22void (*f)() = 0;
Daniel Dunbar457f33d2009-01-28 21:22:12 +000023
24typedef __attribute__(( ext_vector_type(2) )) int Vi2;
25typedef __attribute__(( ext_vector_type(2) )) float Vf2;
26
27Vf2 g0; // expected-note {{previous definition is here}}
28Vi2 g0; // expected-error {{redefinition of 'g0'}}
29
30_Complex int g1; // expected-note {{previous definition is here}}
31_Complex float g1; // expected-error {{redefinition of 'g1'}}