2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / ext / dllimport6.C
blob3b2a082f9b2a33fb46b64c08a0fcf470f6470fb3
1 // { dg-do compile { target i?86-*-cygwin* i?86-*-mingw*} }
2 //  Mark class static members as dllimport.
4 struct Baz
6   Baz(int a_ =0) : a(a_) {}; 
7   int a;
8 };
10 class  __attribute__ ((dllimport)) Bar
12   public:
13     static const int two = 2;
14     static const int three;
15     static const Baz null_baz;
18 int foo()
20   Bar foobar;
21   const int* baz = &Bar::two; 
22   int a = foobar.two;
23   int b = foobar.three;
24   int c = foobar.null_baz.a;
25   return (a + b + c + *baz);
28 // { dg-final { scan-assembler __imp___ZN3Bar3twoE } }
29 // { dg-final { scan-assembler __imp___ZN3Bar5threeE } }
30 // { dg-final { scan-assembler __imp___ZN3Bar8null_bazE } }