| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-gdwarf-2 -dA" } */ |
| 3 |
struct S |
| 4 |
{ |
| 5 |
S() {} |
| 6 |
~S() {} |
| 7 |
static const S array[2]; |
| 8 |
}; |
| 9 |
|
| 10 |
const S S::array[2] = { S(), S() }; |
| 11 |
|
| 12 |
/* Verify that we get only one DW_TAG_subrange_type (plus the abbrev), |
| 13 |
and one DW_AT_upper_bound (non-abbrev), because the array |
| 14 |
definition loses the readonly wrapper for the array type because of |
| 15 |
the dynamic initializers. The const types are 3: S, S*, and |
| 16 |
S[2], plus the abbrev. A const version of S[2] doesn't make sense, |
| 17 |
but we output it. */ |
| 18 |
/* { dg-final { scan-assembler-times " DW_TAG_const_type" 4 } } */ |
| 19 |
/* { dg-final { scan-assembler-times " DW_TAG_subrange_type" 2 } } */ |
| 20 |
/* { dg-final { scan-assembler-times " DW_AT_upper_bound" 1 } } */ |