Commit ac125082 by Eric Botcazou Committed by Eric Botcazou

20081112-1.c: New test.

	* gcc.c-torture/execute/20081112-1.c: New test.
	* gnat.dg/concat1.adb: Likewise.
	* gnat.dg/concat1_pkg.ad[sb]: New helper.

From-SVN: r141806
parent e61c76c9
2008-11-12 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/execute/20081112-1.c: New test.
* gnat.dg/concat1.adb: Likewise.
* gnat.dg/concat1_pkg.ad[sb]: New helper.
2008-11-12 Jason Merrill <jason@redhat.com>
PR c++/38007
......
#include <limits.h>
extern void abort (void);
static __attribute__((noinline)) void foo (int a)
{
int b = (a - 1) + INT_MIN;
if (b != INT_MIN)
abort ();
}
int main (void)
{
foo (1);
return 0;
}
-- { dg-do run }
-- { dg-options "-O2" }
with Concat1_Pkg; use Concat1_Pkg;
procedure Concat1 is
Ident_1 : Integer := Ident (1);
Ident_2 : Integer := Ident (2);
Ident_5 : Integer := Ident (5);
type Arr is array (Integer range <>) of Integer;
A : Arr (1..10);
begin
A := (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
A := 0 & A(Ident_1..Ident_2) & A(Ident_1..Ident_2) & A(Ident_1..Ident_5);
if A /= (0, 1, 2, 1, 2, 1, 2, 3, 4, 5) then
raise Program_Error;
end if;
end;
package body Concat1_Pkg is
function Ident (I : Integer) return Integer is begin return I; end;
end Concat1_Pkg;
package Concat1_Pkg is
function Ident (I : Integer) return Integer;
end Concat1_Pkg;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment