diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-10 14:59:03 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-10 14:59:03 +0000 |
commit | 12b2266af600824b8460918bd694233b07dd3f67 (patch) | |
tree | 565cfbb286832550c168bf426ddaad6fbe1e11e8 /exception_test2 | |
parent | 19e0c8f9177d08402ebaa4e5c05e6a523e3b455f (diff) |
2008-09-10 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile: Add new tests. Most of these eitehr demonstrate or verify a
particular functionality.
* cpuuse/Makefile, cpuuse/cpuuse.adb, exception_test2/Makefile,
exception_test2/exceptiontest2.adb, exception_test3/Makefile,
exception_test3/exceptiontest3.adb: New files.
Diffstat (limited to 'exception_test2')
-rw-r--r-- | exception_test2/Makefile | 23 | ||||
-rw-r--r-- | exception_test2/exceptiontest2.adb | 25 |
2 files changed, 48 insertions, 0 deletions
diff --git a/exception_test2/Makefile b/exception_test2/Makefile new file mode 100644 index 0000000..faa9f1d --- /dev/null +++ b/exception_test2/Makefile @@ -0,0 +1,23 @@ +# +# See README.Makefiles in the main ada-examples directory. +# + +PROGRAM=exceptiontest2 + +include $(RTEMS_MAKEFILE_PATH)/Makefile.inc +include $(RTEMS_CUSTOM) +include $(PROJECT_ROOT)/make/leaf.cfg + +# stack size for the first Ada thread +CFLAGS +=-DGNAT_MAIN_STACKSPACE=100 + +# initialize the network stack -- assumes existence of networkconfig.h +# CFLAGS +=-DMAIN_USE_NETWORKING=1 + +# Should we prompt for command line arguments? +# DEFINES +=-DMAIN_USE_REQUIRES_COMMAND_LINE + +# If you want to hard-code the command line, define this to a string +# DEFINES += -DMAIN_COMMAND_LINE="ARGS" + +include ../Makefile.shared diff --git a/exception_test2/exceptiontest2.adb b/exception_test2/exceptiontest2.adb new file mode 100644 index 0000000..822ee1a --- /dev/null +++ b/exception_test2/exceptiontest2.adb @@ -0,0 +1,25 @@ +--BEGIN exceptiontest2.adb +with Ada.Text_IO; use Ada.Text_IO; + +procedure ExceptionTest2 is + function F return Boolean is + begin + raise Constraint_Error; + return True; + end F; +begin + begin + if F then + Put_Line ("Not ok"); + else + Put_Line ("Not ok and bad value"); + end if; + exception + when others => + Put_Line ("Caught Constraint_Error -- inner"); + end; +exception + when others => + Put_Line ("Caught Constraint_Error -- outer -- not OK"); +end ExceptionTest2; +--END exceptiontest2.adb |