1-- { dg-do run } 2-- { dg-options "-gnatp -fstrict-volatile-bitfields" } 3 4procedure Misaligned_Volatile is 5 6 type Byte is mod 2**8; 7 8 type Block is record 9 B : Boolean; 10 V : Byte; 11 end record; 12 pragma Volatile (Block); 13 pragma Pack (Block); 14 for Block'Alignment use 1; 15 16 type Pair is array (1 .. 2) of Block; 17 18 P : Pair; 19begin 20 for K in P'Range loop 21 P(K).V := 237; 22 end loop; 23 for K in P'Range loop 24 if P(K).V /= 237 then 25 raise Program_error; 26 end if; 27 end loop; 28end; 29