From: Eric Botcazou Date: Wed, 12 Nov 2008 21:48:59 +0000 (+0000) Subject: 20081112-1.c: New test. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ac12508218a55bb3a9973b2f57ecea0003e995e3;p=gcc.git 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 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a14100fe312..783b08fbc51 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2008-11-12 Eric Botcazou + + * 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 PR c++/38007 diff --git a/gcc/testsuite/gcc.c-torture/execute/20081112-1.c b/gcc/testsuite/gcc.c-torture/execute/20081112-1.c new file mode 100644 index 00000000000..1efe0168577 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20081112-1.c @@ -0,0 +1,17 @@ +#include + +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; +} diff --git a/gcc/testsuite/gnat.dg/concat1.adb b/gcc/testsuite/gnat.dg/concat1.adb new file mode 100644 index 00000000000..16b85433ebb --- /dev/null +++ b/gcc/testsuite/gnat.dg/concat1.adb @@ -0,0 +1,21 @@ +-- { 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; diff --git a/gcc/testsuite/gnat.dg/concat1_pkg.adb b/gcc/testsuite/gnat.dg/concat1_pkg.adb new file mode 100644 index 00000000000..4e50e6119b1 --- /dev/null +++ b/gcc/testsuite/gnat.dg/concat1_pkg.adb @@ -0,0 +1,5 @@ +package body Concat1_Pkg is + + function Ident (I : Integer) return Integer is begin return I; end; + +end Concat1_Pkg; diff --git a/gcc/testsuite/gnat.dg/concat1_pkg.ads b/gcc/testsuite/gnat.dg/concat1_pkg.ads new file mode 100644 index 00000000000..8690ba22f1b --- /dev/null +++ b/gcc/testsuite/gnat.dg/concat1_pkg.ads @@ -0,0 +1,5 @@ +package Concat1_Pkg is + + function Ident (I : Integer) return Integer; + +end Concat1_Pkg;