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