diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2011-09-26 12:41:17 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2011-09-26 12:41:17 +0000 |
commit | 412dd7641e710990fc011b48460f9c372f979b57 (patch) | |
tree | 6e9c25b5eccd0ac15207b47b8c9a1aa6c2ec9f55 /gcc | |
parent | 703ffc3005c21d95d957e2fdc89f0c54f937c9a1 (diff) | |
download | gcc-412dd7641e710990fc011b48460f9c372f979b57.zip gcc-412dd7641e710990fc011b48460f9c372f979b57.tar.gz gcc-412dd7641e710990fc011b48460f9c372f979b57.tar.bz2 |
opt22.adb: New test.
2011-09-26 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/opt22.adb: New test.
* gnat.dg/opt22_pkg.ad[sb]: New helper.
From-SVN: r179194
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/opt22.adb | 20 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/opt22_pkg.adb | 15 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/opt22_pkg.ads | 7 |
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; |