https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67837

            Bug ID: 67837
           Summary: Ada ATC with delay abort syscalls not working
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nicolas.boulenguez at free dot fr
  Target Milestone: ---

As I understand the reference manual, the following program
  with Ada.Calendar; use Ada.Calendar;
  with Ada.Text_IO;  use Ada.Text_IO;
  with Interfaces.C; use Interfaces.C;
  procedure Main is
     function usleep (Secs : int) return int;
     pragma Import (C, usleep, "usleep");
     Res        : int;
     Start_Time : Time := Clock;
  begin
     select
        delay 1.0;
        Put_Line ("OK:" & Integer'Image (Integer (Clock - Start_Time)));
     then abort
        Res := usleep (10_000_000);
        Put_Line ("KO:" & Integer'Image (Integer (Clock - Start_Time)));
     end select;
  end Main;
should produce
  OK: 1
Instead, on amd64 with gnat-5.2.1-17:
  KO: 1
  OK: 1
and on mips with gnat-5.2.1-19:
  KO: 10
  OK: 10

The whole history can be found at https://bugs.debian.org/673772.

Reply via email to