aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-11-12 21:48:59 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-11-12 21:48:59 +0000
commitac12508218a55bb3a9973b2f57ecea0003e995e3 (patch)
tree434a239fd3da2346e9187e61c18c43d7ea458ff6 /gcc
parente61c76c9694ab63c2a3b4324f75affda62c3718b (diff)
downloadgcc-ac12508218a55bb3a9973b2f57ecea0003e995e3.zip
gcc-ac12508218a55bb3a9973b2f57ecea0003e995e3.tar.gz
gcc-ac12508218a55bb3a9973b2f57ecea0003e995e3.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20081112-1.c17
-rw-r--r--gcc/testsuite/gnat.dg/concat1.adb21
-rw-r--r--gcc/testsuite/gnat.dg/concat1_pkg.adb5
-rw-r--r--gcc/testsuite/gnat.dg/concat1_pkg.ads5
5 files changed, 54 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a14100f..783b08f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+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
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 0000000..1efe016
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20081112-1.c
@@ -0,0 +1,17 @@
+#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;
+}
diff --git a/gcc/testsuite/gnat.dg/concat1.adb b/gcc/testsuite/gnat.dg/concat1.adb
new file mode 100644
index 0000000..16b8543
--- /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 0000000..4e50e61
--- /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 0000000..8690ba2
--- /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;