gcc/testsuite/gnat.dg/volatile9.adb
raw| 1 | -- { dg-do compile } |
| 2 | -- { dg-options "-O2 -fdump-tree-optimized" } |
| 3 | |
| 4 | function Volatile9 return Integer is |
| 5 | |
| 6 | type A is array (1..4) of Integer; |
| 7 | pragma Volatile_Components (A); |
| 8 | |
| 9 | V : A := (others => 0); |
| 10 | |
| 11 | begin |
| 12 | for J in 1 .. 10 loop |
| 13 | V(1) := V(1) + 1; |
| 14 | end loop; |
| 15 | |
| 16 | return V(1); |
| 17 | end; |
| 18 | |
| 19 | -- { dg-final { scan-tree-dump "goto" "optimized" } } |