OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gnat.dg/] [opt2.adb] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 696 jeremybenn
-- { dg-do run }
2
-- { dg-options "-O2 -fno-inline" }
3
 
4
procedure Opt2 is
5
   function Get return String is
6
   begin
7
      return "[]";
8
   end Get;
9
 
10
   Message : String := Get;
11
 
12
   F, L : Integer;
13
begin
14
   for J in Message'Range loop
15
      if Message (J) = '[' then
16
         F := J;
17
      elsif Message (J) = ']' then
18
         L := J;
19
         exit;
20
      end if;
21
   end loop;
22
 
23
   declare
24
      M : String :=
25
         Message (Message'First .. F) & Message (L .. Message'Last);
26
   begin
27
      if M /= "[]" then
28
        raise Program_Error;
29
      end if;
30
   end;
31
end;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.