dllimport2.C revision 1.1.1.1
1// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} } 2 3// PR c++/9738 Dllimport attribute is overriden by later definition/redeclaration 4 5void __attribute__((dllimport)) Bar(void); 6void __attribute__((dllimport)) Baz(void); 7__attribute__((dllimport)) int Biz; 8__attribute__((dllimport)) int Boz; 9 10void Foo(void) 11 { 12 Bar(); 13 Baz(); 14 Biz++; 15 Boz++; 16 } 17 18void Bar(void) 19 { // { dg-warning "defined" } 20 } 21 22void Baz(void); // { dg-warning "redeclared" } 23extern int Biz; // { dg-warning "redeclared" } 24int Boz; // { dg-warning "defined" } 25 26void foo() 27{ 28 Biz++; 29} 30