| 1 |
// { dg-do compile { target i?86-*-cygwin* i?86-*-mingw* x86_64-*-mingw* } } |
| 2 |
// Mark class static members as dllimport. |
| 3 |
|
| 4 |
struct Baz |
| 5 |
{ |
| 6 |
Baz(int a_ =0) : a(a_) {} |
| 7 |
int a; |
| 8 |
}; |
| 9 |
|
| 10 |
class __attribute__ ((dllimport)) Bar |
| 11 |
{ |
| 12 |
public: |
| 13 |
static const int two = 2; |
| 14 |
static const int three; |
| 15 |
static const Baz null_baz; |
| 16 |
}; |
| 17 |
|
| 18 |
int foo() |
| 19 |
{ |
| 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); |
| 26 |
} |
| 27 |
|
| 28 |
// { dg-final { scan-assembler __imp\[_\]*__ZN3Bar3twoE } } |
| 29 |
// { dg-final { scan-assembler __imp\[_\]*__ZN3Bar5threeE } } |
| 30 |
// { dg-final { scan-assembler __imp\[_\]*__ZN3Bar8null_bazE } } |