Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / g++.dg / ext / dllimport2.C
blob7b3f68575de28df6bfd6bdf6b9c462a867e16d9d
1 // { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }
3 // PR c++/9738  Dllimport attribute is overriden by later definition/redeclaration
5 void __attribute__((dllimport)) Bar(void);
6 void __attribute__((dllimport)) Baz(void);
7 __attribute__((dllimport)) int Biz;
8 __attribute__((dllimport)) int Boz;
10 void Foo(void)
11   {
12     Bar();
13     Baz();
14     Biz++;       
15     Boz++;       
16   }
18 void Bar(void)          // { dg-warning "defined" }
19   {
20   }
22 void Baz(void);         // { dg-warning "redeclared" }
23 extern int Biz;         // { dg-warning "redeclared" }
24 int Boz;                // { dg-warning "defined" }
26 void foo()
28   Biz++;