* gcc.dg/stack-check-5.c: Skip with -fstack-protector.
[official-gcc.git] / gcc / testsuite / gnat.dg / opt67.adb
blob20590d17ad0400532e25d9eef2b36924cfd4430d
1 -- { dg-do run }
2 -- { dg-options "-O" }
4 with Opt67_Pkg; use Opt67_Pkg;
6 procedure Opt67 is
8 function Predef_Stream_Attr_Spec
9 (Loc : Source_Ptr;
10 Tag_Typ : Entity_Id;
11 Name : TSS_Name_Type) return Node_Id is
12 begin
13 return Predef (Loc, Make_TSS_Name (Tag_Typ, Name), Tag_Typ);
14 end;
16 Stream_Op_TSS_Names :
17 constant array (Integer range <>) of TSS_Name_Type :=
18 (TSS_Stream_Read,
19 TSS_Stream_Write,
20 TSS_Stream_Input,
21 TSS_Stream_Output);
23 Tag_Typ : constant Entity_Id := Entity_Id(Init);
24 Res : constant Natural := Init;
25 Loc : constant Source_Ptr := Source_Ptr(Init);
27 begin
28 for Op in Stream_Op_TSS_Names'Range loop
29 if Stream_Operation_OK (Tag_Typ, Stream_Op_TSS_Names (Op)) then
30 Append_To (Res,
31 Predef_Stream_Attr_Spec (Loc, Tag_Typ,
32 Stream_Op_TSS_Names (Op)));
33 end if;
34 end loop;
35 end;