| 1 |
// { dg-do compile } |
| 2 |
// { dg-options "-O2" } |
| 3 |
|
| 4 |
typedef unsigned long T; |
| 5 |
typedef volatile T* const hwreg_t; |
| 6 |
struct RegisterLayout |
| 7 |
{ |
| 8 |
T intmask; |
| 9 |
}; |
| 10 |
struct Controller_t |
| 11 |
{ |
| 12 |
Controller_t(); |
| 13 |
inline void |
| 14 |
disableInterrupt() |
| 15 |
{ |
| 16 |
*mpMaskRegister = 0; |
| 17 |
}; |
| 18 |
static hwreg_t mpMaskRegister; |
| 19 |
}; |
| 20 |
|
| 21 |
extern char SimulatedRegisters[]; |
| 22 |
|
| 23 |
hwreg_t Controller_t::mpMaskRegister |
| 24 |
= &(reinterpret_cast<volatile RegisterLayout*>(SimulatedRegisters))->intmask; |
| 25 |
|
| 26 |
Controller_t::Controller_t() |
| 27 |
{ |
| 28 |
disableInterrupt(); |
| 29 |
} |