tree-optimization/113385 - wrong loop father with early exit vectorization
[official-gcc.git] / gcc / testsuite / gnat.dg / dynhash1.adb
blobe2010de91f70afd471fe29a3e7a7719ded3c7b10
1 -- { dg-do run }
3 with Ada.Text_IO; use Ada.Text_IO;
4 with GNAT; use GNAT;
5 with GNAT.Dynamic_HTables; use GNAT.Dynamic_HTables;
7 procedure Dynhash1 is
8 procedure Destroy (Val : in out Integer) is null;
9 function Hash (Key : Integer) return Bucket_Range_Type is
10 begin
11 return Bucket_Range_Type (Key);
12 end Hash;
14 package Integer_Hash_Tables is new Dynamic_Hash_Tables
15 (Key_Type => Integer,
16 Value_Type => Integer,
17 No_Value => 0,
18 Expansion_Threshold => 1.3,
19 Expansion_Factor => 2,
20 Compression_Threshold => 0.3,
21 Compression_Factor => 2,
22 "=" => "=",
23 Destroy_Value => Destroy,
24 Hash => Hash);
25 use Integer_Hash_Tables;
27 Siz : Natural;
28 T : Dynamic_Hash_Table;
30 begin
31 T := Create (8);
33 Put (T, 1, 1);
34 Put (T, 1, 2);
35 Put (T, 1, 3);
37 Siz := Size (T);
39 if Siz /= 1 then
40 Put_Line ("ERROR: Put: wrong size");
41 Put_Line ("expected: 1");
42 Put_Line ("got :" & Siz'Img);
43 end if;
45 Delete (T, 1);
46 Delete (T, 1);
48 Siz := Size (T);
50 if Siz /= 0 then
51 Put_Line ("ERROR: Delete: wrong size");
52 Put_Line ("expected: 0");
53 Put_Line ("got :" & Siz'Img);
54 end if;
56 Destroy (T);
57 end Dynhash1;