aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gnat.dg/opt22.adb20
-rw-r--r--gcc/testsuite/gnat.dg/opt22_pkg.adb15
-rw-r--r--gcc/testsuite/gnat.dg/opt22_pkg.ads7
4 files changed, 47 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2546ce1..35dea73 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+ * gnat.dg/opt22.adb: New test.
+ * gnat.dg/opt22_pkg.ad[sb]: New helper.
+
+2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
+
* gnat.dg/opt21.adb: New test.
* gnat.dg/opt21_pkg.ad[sb]: New helper.
diff --git a/gcc/testsuite/gnat.dg/opt22.adb b/gcc/testsuite/gnat.dg/opt22.adb
new file mode 100644
index 0000000..6ea2440
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt22.adb
@@ -0,0 +1,20 @@
+-- { dg-do run }
+-- { dg-options "-O" }
+
+with Opt22_Pkg; use Opt22_Pkg;
+
+procedure Opt22 is
+
+ procedure Go (S : String) is
+ begin
+ begin
+ Fail;
+ exception
+ when Constraint_Error => Put ("the " & S);
+ end;
+ Put ("the " & S);
+ end;
+
+begin
+ Go ("message");
+end;
diff --git a/gcc/testsuite/gnat.dg/opt22_pkg.adb b/gcc/testsuite/gnat.dg/opt22_pkg.adb
new file mode 100644
index 0000000..fa05dfe
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt22_pkg.adb
@@ -0,0 +1,15 @@
+package body Opt22_Pkg is
+
+ procedure Fail is
+ begin
+ raise Constraint_Error;
+ end;
+
+ procedure Put (S : String) is
+ begin
+ if S /= "the message" then
+ raise Program_Error;
+ end if;
+ end;
+
+end Opt22_Pkg;
diff --git a/gcc/testsuite/gnat.dg/opt22_pkg.ads b/gcc/testsuite/gnat.dg/opt22_pkg.ads
new file mode 100644
index 0000000..2822409
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt22_pkg.ads
@@ -0,0 +1,7 @@
+package Opt22_Pkg is
+
+ procedure Fail;
+
+ procedure Put (S : String);
+
+end Opt22_Pkg;