* tree.c (handle_dll_attribute): Move here from i383/winnt.c.
[official-gcc.git] / gcc / testsuite / gcc.dg / dll-2.c
blob00c683a728ca8dbca0d9f5c522f93ef8a8cf8ed3
1 /* These dllimport and dllexport appearing for a symbol.
2 The desired behavior is that if both dllimport
3 and dllexport appear (in either order) the result is dllexport.
5 Microsoft's MSVC 2.0 allows dllimport followed by dllexport for variables,
6 but does not allow dllexport followed by dllimport.
8 In C, it's ok to redeclare a variable so this works for variables
9 and functions. In C++, it only works for functions. */
11 /* { dg-require-dll } */
13 __declspec (dllimport) int foo1 ();
14 __declspec (dllexport) int foo1 ();
16 __declspec (dllexport) int foo2 ();
17 __declspec (dllimport) int foo2 ();
19 __declspec (dllimport) int bar1;
20 __declspec (dllexport) int bar1;
22 __declspec (dllexport) int bar2;
23 __declspec (dllimport) int bar2;