gcc/testsuite/gnat.dg/opt105.adb
raw| 1 | -- { dg-do run } |
| 2 | -- { dg-options "-O" } |
| 3 | |
| 4 | with Opt105_Pkg; use Opt105_Pkg; |
| 5 | |
| 6 | procedure Opt105 is |
| 7 | |
| 8 | Val : constant Enum := |
| 9 | (if Enabled then (if Disabled then Two else One) else Three); |
| 10 | |
| 11 | begin |
| 12 | if Cond1 then |
| 13 | return; |
| 14 | end if; |
| 15 | |
| 16 | if Cond2 then |
| 17 | return; |
| 18 | end if; |
| 19 | |
| 20 | case Val is |
| 21 | when One => |
| 22 | raise Program_Error; |
| 23 | |
| 24 | when Two => |
| 25 | raise Constraint_Error; |
| 26 | |
| 27 | when Three => |
| 28 | null; |
| 29 | end case; |
| 30 | end; |