OSDN Git Service

* gnat.dg/lto6.adb: Remove superfluous -gnat05 switch.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gnat.dg / aliasing1.adb
1 -- { dg-do compile }
2 -- { dg-options "-O2 -gnatp -fdump-tree-optimized" }
3
4 -- The raise statement must be optimized away by
5 -- virtue of DECL_NONADDRESSABLE_P set on R.I.
6
7 package body Aliasing1 is
8
9   function F (P : Ptr) return Integer is
10   begin
11     R.I := 0;
12     P.all := 1;
13     if R.I /= 0 then
14       raise Program_Error;
15     end if;
16     return 0;
17   end;
18
19 end Aliasing1;
20
21 -- { dg-final { scan-tree-dump-not "__gnat_rcheck" "optimized" } }
22 -- { dg-final { cleanup-tree-dump "optimized" } }