PR tree-optimization/86415 - strlen() not folded for substrings within constant arrays
[official-gcc.git] / gcc / testsuite / gnat.dg / hyper_flat.adb
blob6842edbf52ad48d7d9ab28b490e7bc73a77bd32d
1 -- { dg-do run }
2 -- { dg-options "-gnatp" }
4 procedure Hyper_Flat is
6 type Unsigned is mod 2 ** 32;
7 x : Integer := 0;
8 pragma Volatile (X);
10 S : constant String := (1 .. X - 3 => 'A');
11 -- Hyper-flat null string
13 begin
14 if Unsigned'(S'Length) /= 0 then
15 raise Program_Error;
16 end if;
17 end;