OSDN Git Service

5a13a509d4f8d4f268d6307e4a403a3389503911
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / ext / dllimport3.C
1 // { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }
2
3 // PR 10148  Dllimport attribute of object is overriden by later
4 // redefinition without attribute.
5  
6 struct Foo
7  {
8      int a;
9  };
10
11  __attribute__((dllimport)) struct Foo f;
12
13  void Bar(void)
14  {
15      void* dummy = &f;
16  }
17
18  struct Foo f;  // { dg-warning "defined" }
19
20 // Dllimport sets DECL_NON_ADDR_CONST_P to 1, so following
21 // assignment would require static_initialization_and_destruction
22 // if attribute is retained. 
23
24  void* dummy = &f;
25