summaryrefslogtreecommitdiffstats
path: root/testsuites/ada/sptests/sp19
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites/ada/sptests/sp19')
-rw-r--r--testsuites/ada/sptests/sp19/Makefile.am20
-rw-r--r--testsuites/ada/sptests/sp19/README19
-rw-r--r--testsuites/ada/sptests/sp19/ada_sp19.scn55
-rw-r--r--testsuites/ada/sptests/sp19/config.h30
-rw-r--r--testsuites/ada/sptests/sp19/sp19.adb55
-rw-r--r--testsuites/ada/sptests/sp19/sptest.adp397
-rw-r--r--testsuites/ada/sptests/sp19/sptest.ads119
7 files changed, 695 insertions, 0 deletions
diff --git a/testsuites/ada/sptests/sp19/Makefile.am b/testsuites/ada/sptests/sp19/Makefile.am
new file mode 100644
index 0000000000..27e7d7ca28
--- /dev/null
+++ b/testsuites/ada/sptests/sp19/Makefile.am
@@ -0,0 +1,20 @@
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+
+include $(top_srcdir)/ada.am
+
+AM_ADAFLAGS += -I.
+
+noinst_PROGRAMS = ada_sp19
+ada_sp19_SOURCES = sp19.adb sptest.adb config.h sptest.ads
+ada_sp19_SOURCES += ../../support/init.c
+
+CLEANFILES += sptest.adb
+
+ada_sp19$(EXEEXT): sp19.adb sptest.adb sptest.ads init.$(OBJEXT)
+ $(GNATCOMPILE) -margs -a $< -o $@
+
+scndir = $(rtems_ada_testsdir)
+dist_scn_DATA = ada_sp19.scn
+
+include $(top_srcdir)/../automake/local.am
diff --git a/testsuites/ada/sptests/sp19/README b/testsuites/ada/sptests/sp19/README
new file mode 100644
index 0000000000..4fd698381e
--- /dev/null
+++ b/testsuites/ada/sptests/sp19/README
@@ -0,0 +1,19 @@
+This is a "problem" test in Ada versus the C equivalent. In C,
+we used macros to :
+
+ + declare a LOT of local integer and floating point variables
+ + load them with values
+ + check them at certain times
+ + to avoid floating point operations on CPUs w/o hardware support
+
+The macros are not equivalent to subprograms doing the same thing.
+We are trying to insure that the register set is fully utilized and
+checking that it survives context switches. If the routines are
+subprograms, then calling conventions and scoping rules apply. Thus
+the variables do not exist throughout the entire life of the task
+as in the C test.
+
+It seems to point out that although the conditional compilation
+and macro capabilities of C are often abused, they do provide
+capabilities which are difficult if not impossible to mimic entirely
+with subprograms.
diff --git a/testsuites/ada/sptests/sp19/ada_sp19.scn b/testsuites/ada/sptests/sp19/ada_sp19.scn
new file mode 100644
index 0000000000..573860bb59
--- /dev/null
+++ b/testsuites/ada/sptests/sp19/ada_sp19.scn
@@ -0,0 +1,55 @@
+*** TEST 19 ***
+FP1 - integer base = ( 16#6000#)
+FP1 - float base = ( 6.00060E+03)
+FP1 - integer base = ( 16#6000#)
+FP1 - float base = ( 6.00060E+03)
+TA1 - integer base = ( 16#1000#)
+TA1 - clock_get - 9: 0: 0 12/31/1988
+TA2 - integer base = ( 16#2000#)
+TA2 - clock_get - 9: 0: 0 12/31/1988
+TA3 - integer base = ( 16#3000#)
+TA3 - clock_get - 9: 0: 0 12/31/1988
+TA4 - integer base = ( 16#4000#)
+TA4 - float base = ( 4.00040E+03)
+TA4 - clock_get - 9: 0: 0 12/31/1988
+TA5 - integer base = ( 16#5000#)
+TA5 - float base = ( 5.00050E+03)
+TA5 - clock_get - 9: 0: 0 12/31/1988
+TA4 - clock_get - 9: 0: 1 12/31/1988
+TA5 - clock_get - 9: 0: 1 12/31/1988
+TA4 - clock_get - 9: 0: 2 12/31/1988
+TA5 - clock_get - 9: 0: 2 12/31/1988
+TA4 - clock_get - 9: 0: 3 12/31/1988
+TA5 - clock_get - 9: 0: 3 12/31/1988
+TA4 - clock_get - 9: 0: 4 12/31/1988
+TA5 - clock_get - 9: 0: 4 12/31/1988
+TA1 - clock_get - 9: 0: 5 12/31/1988
+TA4 - clock_get - 9: 0: 5 12/31/1988
+TA5 - clock_get - 9: 0: 5 12/31/1988
+TA4 - clock_get - 9: 0: 6 12/31/1988
+TA5 - clock_get - 9: 0: 6 12/31/1988
+TA4 - clock_get - 9: 0: 7 12/31/1988
+TA5 - clock_get - 9: 0: 7 12/31/1988
+TA4 - clock_get - 9: 0: 8 12/31/1988
+TA5 - clock_get - 9: 0: 8 12/31/1988
+TA4 - clock_get - 9: 0: 9 12/31/1988
+TA5 - clock_get - 9: 0: 9 12/31/1988
+TA2 - clock_get - 9: 0:10 12/31/1988
+TA1 - clock_get - 9: 0:10 12/31/1988
+TA4 - clock_get - 9: 0:10 12/31/1988
+TA5 - clock_get - 9: 0:10 12/31/1988
+TA4 - clock_get - 9: 0:11 12/31/1988
+TA5 - clock_get - 9: 0:11 12/31/1988
+TA4 - clock_get - 9: 0:12 12/31/1988
+TA5 - clock_get - 9: 0:12 12/31/1988
+TA4 - clock_get - 9: 0:13 12/31/1988
+TA5 - clock_get - 9: 0:13 12/31/1988
+TA4 - clock_get - 9: 0:14 12/31/1988
+TA5 - clock_get - 9: 0:14 12/31/1988
+TA1 - clock_get - 9: 0:15 12/31/1988
+TA3 - clock_get - 9: 0:15 12/31/1988
+TA4 - clock_get - 9: 0:15 12/31/1988
+TA5 - clock_get - 9: 0:15 12/31/1988
+TA4 - task_delete - self
+TA5 - task_delete - TA3
+*** END OF TEST 19 ***
diff --git a/testsuites/ada/sptests/sp19/config.h b/testsuites/ada/sptests/sp19/config.h
new file mode 100644
index 0000000000..278aaf69b0
--- /dev/null
+++ b/testsuites/ada/sptests/sp19/config.h
@@ -0,0 +1,30 @@
+/* config.h
+ *
+ * This include file defines the Configuration Table for this test.
+ *
+ * COPYRIGHT (c) 1989-2007.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may in
+ * the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+
+/* configuration information */
+
+#define CONFIGURE_SPTEST
+
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+
+#define CONFIGURE_POSIX_INIT_THREAD_TABLE
+
+#define CONFIGURE_MAXIMUM_POSIX_THREADS 10
+#define CONFIGURE_MAXIMUM_POSIX_KEYS 10
+
+#define CONFIGURE_MAXIMUM_TASKS 7
+
+#include <rtems/confdefs.h>
+
+/* end of include file */
diff --git a/testsuites/ada/sptests/sp19/sp19.adb b/testsuites/ada/sptests/sp19/sp19.adb
new file mode 100644
index 0000000000..f2cfddb97a
--- /dev/null
+++ b/testsuites/ada/sptests/sp19/sp19.adb
@@ -0,0 +1,55 @@
+--
+-- MAIN / BODY
+--
+-- DESCRIPTION:
+--
+-- This is the entry point for Test SP19 of the Single Processor Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+with SPTEST;
+with TEST_SUPPORT;
+
+procedure SP19 is
+ INIT_ID : RTEMS.ID;
+ STATUS : RTEMS.STATUS_CODES;
+begin
+
+ RTEMS.TASKS.CREATE(
+ RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ),
+ 1,
+ RTEMS.MINIMUM_STACK_SIZE,
+ RTEMS.NO_PREEMPT,
+ RTEMS.FLOATING_POINT,
+ INIT_ID,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" );
+
+
+ RTEMS.TASKS.START(
+ INIT_ID,
+ SPTEST.INIT'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" );
+
+ loop
+ delay 120.0;
+ end loop;
+
+end SP19;
+
diff --git a/testsuites/ada/sptests/sp19/sptest.adp b/testsuites/ada/sptests/sp19/sptest.adp
new file mode 100644
index 0000000000..d49bf41aac
--- /dev/null
+++ b/testsuites/ada/sptests/sp19/sptest.adp
@@ -0,0 +1,397 @@
+--
+-- SPTEST / BODY
+--
+-- DESCRIPTION:
+--
+-- This package is the implementation of Test 19 of the RTEMS
+-- Single Processor Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+-- On-Line Applications Research Corporation (OAR).
+--
+
+with INTERFACES; use INTERFACES;
+with FLOAT_IO;
+with TEST_SUPPORT;
+with TEXT_IO;
+with UNSIGNED32_IO;
+with RTEMS.CLOCK;
+
+include(../../support/fp.inc)
+include(../../support/integer.inc)
+
+package body SPTEST is
+
+--
+-- INIT
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ begin
+
+ TEXT_IO.NEW_LINE( 2 );
+ TEXT_IO.PUT_LINE( "*** TEST 19 ***" );
+
+ SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' );
+ SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' );
+ SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' );
+ SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' );
+ SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' );
+ SPTEST.TASK_NAME( 6 ) := RTEMS.BUILD_NAME( 'F', 'P', '1', ' ' );
+
+ RTEMS.TASKS.CREATE(
+ SPTEST.TASK_NAME( 1 ),
+ 2,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.FLOATING_POINT,
+ SPTEST.TASK_ID( 1 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
+
+ RTEMS.TASKS.CREATE(
+ SPTEST.TASK_NAME( 2 ),
+ 2,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ SPTEST.TASK_ID( 2 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" );
+
+ RTEMS.TASKS.CREATE(
+ SPTEST.TASK_NAME( 3 ),
+ 2,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.DEFAULT_ATTRIBUTES,
+ SPTEST.TASK_ID( 3 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" );
+
+ RTEMS.TASKS.CREATE(
+ SPTEST.TASK_NAME( 4 ),
+ 2,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.FLOATING_POINT,
+ SPTEST.TASK_ID( 4 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" );
+
+ RTEMS.TASKS.CREATE(
+ SPTEST.TASK_NAME( 5 ),
+ 2,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.FLOATING_POINT,
+ SPTEST.TASK_ID( 5 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA5" );
+
+ RTEMS.TASKS.CREATE(
+ SPTEST.TASK_NAME( 6 ),
+ 1,
+ 2048,
+ RTEMS.DEFAULT_MODES,
+ RTEMS.FLOATING_POINT,
+ SPTEST.TASK_ID( 6 ),
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF FP1" );
+
+ RTEMS.TASKS.START(
+ SPTEST.TASK_ID( 6 ),
+ SPTEST.FIRST_FP_TASK'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF FP1" );
+
+ RTEMS.TASKS.START(
+ SPTEST.TASK_ID( 1 ),
+ SPTEST.TASK_1'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
+
+ RTEMS.TASKS.START(
+ SPTEST.TASK_ID( 2 ),
+ SPTEST.TASK_1'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" );
+
+ RTEMS.TASKS.START(
+ SPTEST.TASK_ID( 3 ),
+ SPTEST.TASK_1'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" );
+
+ RTEMS.TASKS.START(
+ SPTEST.TASK_ID( 4 ),
+ SPTEST.FP_TASK'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" );
+
+ RTEMS.TASKS.START(
+ SPTEST.TASK_ID( 5 ),
+ SPTEST.FP_TASK'ACCESS,
+ 0,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA5" );
+
+ --
+ -- Load "task dependent factors" in the context areas
+ --
+
+ SPTEST.FP_FACTORS( 0 ) := 0.0;
+ SPTEST.FP_FACTORS( 1 ) := 1000.1;
+ SPTEST.FP_FACTORS( 2 ) := 2000.2;
+ SPTEST.FP_FACTORS( 3 ) := 3000.3;
+ SPTEST.FP_FACTORS( 4 ) := 4000.4;
+ SPTEST.FP_FACTORS( 5 ) := 5000.5;
+ SPTEST.FP_FACTORS( 6 ) := 6000.6;
+ SPTEST.FP_FACTORS( 7 ) := 7000.7;
+ SPTEST.FP_FACTORS( 8 ) := 8000.8;
+ SPTEST.FP_FACTORS( 9 ) := 9000.9;
+
+ SPTEST.INTEGER_FACTORS( 0 ) := 16#0000#;
+ SPTEST.INTEGER_FACTORS( 1 ) := 16#1000#;
+ SPTEST.INTEGER_FACTORS( 2 ) := 16#2000#;
+ SPTEST.INTEGER_FACTORS( 3 ) := 16#3000#;
+ SPTEST.INTEGER_FACTORS( 4 ) := 16#4000#;
+ SPTEST.INTEGER_FACTORS( 5 ) := 16#5000#;
+ SPTEST.INTEGER_FACTORS( 6 ) := 16#6000#;
+ SPTEST.INTEGER_FACTORS( 7 ) := 16#7000#;
+ SPTEST.INTEGER_FACTORS( 8 ) := 16#8000#;
+ SPTEST.INTEGER_FACTORS( 9 ) := 16#9000#;
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+
+ end INIT;
+
+--
+-- FIRST_FP_TASK
+--
+
+ procedure FIRST_FP_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ STATUS : RTEMS.STATUS_CODES;
+ TID : RTEMS.ID;
+ TIME : RTEMS.TIME_OF_DAY;
+ TASK_INDEX : RTEMS.UNSIGNED32;
+ INTEGER_DECLARE;
+ FP_DECLARE;
+ begin
+
+ RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
+
+ TASK_INDEX := TEST_SUPPORT.TASK_NUMBER( TID );
+
+ INTEGER_LOAD( INTEGER_FACTORS( TASK_INDEX ) );
+ FP_LOAD( FP_FACTORS( TASK_INDEX ) );
+
+ TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( TASK_INDEX ), FALSE );
+ TEXT_IO.PUT( " - integer base = (" );
+ UNSIGNED32_IO.PUT( INTEGER_FACTORS( TASK_INDEX ), BASE => 16 );
+ TEXT_IO.PUT_LINE( ")" );
+
+ --
+ -- C implementation prints NA if no hardware FP support.
+ --
+
+ TEST_SUPPORT.PUT_NAME(
+ SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ),
+ FALSE
+ );
+ TEXT_IO.PUT( " - float base = (" );
+ FLOAT_IO.PUT( FP_FACTORS( TASK_INDEX ) );
+ TEXT_IO.PUT_LINE( ")" );
+
+ FP_CHECK( FP_FACTORS( TASK_INDEX ) );
+ INTEGER_CHECK( INTEGER_FACTORS( TASK_INDEX ) );
+ if ARGUMENT = 0 then
+ RTEMS.TASKS.RESTART(
+ RTEMS.SELF,
+ 1,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF SELF" );
+ else
+ TIME := ( 1988, 12, 31, 9, 0, 0, 0 );
+ RTEMS.CLOCK.SET( TIME, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" );
+
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
+ end if;
+
+ end FIRST_FP_TASK;
+
+--
+-- FP_TASK
+--
+
+ procedure FP_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ TID : RTEMS.ID;
+ TIME : RTEMS.TIME_OF_DAY;
+ TASK_INDEX : RTEMS.UNSIGNED32;
+ INTEGER_DECLARE;
+ FP_DECLARE;
+ begin
+
+ RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
+
+ TASK_INDEX := TEST_SUPPORT.TASK_NUMBER( TID );
+
+ INTEGER_LOAD( INTEGER_FACTORS( TASK_INDEX ) );
+ FP_LOAD( FP_FACTORS( TASK_INDEX ) );
+
+ TEST_SUPPORT.PUT_NAME(
+ SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ),
+ FALSE
+ );
+ TEXT_IO.PUT( " - integer base = (" );
+ UNSIGNED32_IO.PUT( INTEGER_FACTORS( TASK_INDEX ), BASE => 16 );
+ TEXT_IO.PUT_LINE( ")" );
+
+ --
+ -- C implementation prints NA if no hardware FP support.
+ --
+
+ TEST_SUPPORT.PUT_NAME(
+ SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ),
+ FALSE
+ );
+ TEXT_IO.PUT( " - float base = (" );
+ FLOAT_IO.PUT( FP_FACTORS( TASK_INDEX ) );
+ TEXT_IO.PUT_LINE( ")" );
+
+ loop
+
+ RTEMS.CLOCK.GET_TOD( TIME, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" );
+
+ if TIME.SECOND >= 16 then
+
+ if TEST_SUPPORT.TASK_NUMBER( TID ) = 4 then
+ TEXT_IO.PUT_LINE( "TA4 - task_delete - self" );
+ RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA4" );
+ end if;
+
+ TEXT_IO.PUT_LINE( "TA5 - task_delete - TA3" );
+ RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 3 ), STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" );
+
+ TEXT_IO.PUT_LINE( "*** END OF TEST 19 ***" );
+ RTEMS.SHUTDOWN_EXECUTIVE( 0 );
+ end if;
+
+ TEST_SUPPORT.PUT_NAME(
+ SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ),
+ FALSE
+ );
+
+ TEST_SUPPORT.PRINT_TIME( " - clock_get - ", TIME, "" );
+ TEXT_IO.NEW_LINE;
+
+ INTEGER_CHECK( INTEGER_FACTORS( TASK_INDEX ) );
+ FP_CHECK( FP_FACTORS( TASK_INDEX ) );
+
+ RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
+
+ end loop;
+
+ end FP_TASK;
+
+--
+-- TASK_1
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ ) is
+ pragma Unreferenced(ARGUMENT);
+ STATUS : RTEMS.STATUS_CODES;
+ TID : RTEMS.ID;
+ TIME : RTEMS.TIME_OF_DAY;
+ TASK_INDEX : RTEMS.UNSIGNED32;
+ INTEGER_DECLARE;
+ FP_DECLARE;
+ begin
+
+ RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );
+
+ TASK_INDEX := TEST_SUPPORT.TASK_NUMBER( TID );
+
+ INTEGER_LOAD( INTEGER_FACTORS( TASK_INDEX ) );
+ FP_LOAD( FP_FACTORS( TASK_INDEX ) );
+
+ TEST_SUPPORT.PUT_NAME(
+ SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ),
+ FALSE
+ );
+ TEXT_IO.PUT( " - integer base = (" );
+ UNSIGNED32_IO.PUT( INTEGER_FACTORS( TASK_INDEX ), BASE => 16 );
+ TEXT_IO.PUT_LINE( ")" );
+
+ loop
+
+ RTEMS.CLOCK.GET_TOD( TIME, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" );
+
+ TEST_SUPPORT.PUT_NAME(
+ SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ),
+ FALSE
+ );
+
+ TEST_SUPPORT.PRINT_TIME( " - clock_get - ", TIME, "" );
+ TEXT_IO.NEW_LINE;
+
+ INTEGER_CHECK( INTEGER_FACTORS( TASK_INDEX ) );
+ FP_CHECK( FP_FACTORS( TASK_INDEX ) );
+
+ RTEMS.TASKS.WAKE_AFTER(
+ TEST_SUPPORT.TASK_NUMBER( TID ) * 5 *
+ TEST_SUPPORT.TICKS_PER_SECOND,
+ STATUS
+ );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
+
+ end loop;
+
+ end TASK_1;
+
+end SPTEST;
diff --git a/testsuites/ada/sptests/sp19/sptest.ads b/testsuites/ada/sptests/sp19/sptest.ads
new file mode 100644
index 0000000000..3befd7cc3a
--- /dev/null
+++ b/testsuites/ada/sptests/sp19/sptest.ads
@@ -0,0 +1,119 @@
+--
+-- SPTEST / SPECIFICATION
+--
+-- DESCRIPTION:
+--
+-- This package is the specification for Test 19 of the RTEMS
+-- Single Processor Test Suite.
+--
+-- DEPENDENCIES:
+--
+--
+--
+-- COPYRIGHT (c) 1989-2011.
+-- On-Line Applications Research Corporation (OAR).
+--
+-- The license and distribution terms for this file may in
+-- the file LICENSE in this distribution or at
+-- http://www.rtems.org/license/LICENSE.
+--
+
+with RTEMS;
+with RTEMS.TASKS;
+
+package SPTEST is
+
+--
+-- These arrays contain the IDs and NAMEs of all RTEMS tasks created
+-- by this test.
+--
+
+ TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 6 ) of RTEMS.ID;
+ TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 6 ) of RTEMS.NAME;
+
+--
+-- This array contains the floating point factors used by the
+-- floating point tasks in this test.
+--
+
+ FP_FACTORS : array ( RTEMS.UNSIGNED32 range 0 .. 9 ) of FLOAT;
+
+--
+-- This array contains the integer factors used by the
+-- integer tasks in this test.
+--
+
+ INTEGER_FACTORS : array ( RTEMS.UNSIGNED32 range 0 .. 9 ) of
+ RTEMS.UNSIGNED32;
+
+--
+-- INIT
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task initializes the application.
+--
+
+ procedure INIT (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, INIT);
+
+--
+-- FIRST_FP_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task tests the restart and deletion of floating point tasks.
+--
+
+ procedure FIRST_FP_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, FIRST_FP_TASK);
+
+--
+-- FP_TASK
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task tests the basic capabilities of a floating point
+-- task.
+--
+
+ procedure FP_TASK (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, FP_TASK);
+
+--
+-- TASK_1
+--
+-- DESCRIPTION:
+--
+-- This RTEMS task provides a non-floating point task to test
+-- that an application can utilize a mixture of floating point
+-- and non-floating point tasks.
+--
+
+ procedure TASK_1 (
+ ARGUMENT : in RTEMS.TASKS.ARGUMENT
+ );
+ pragma Convention (C, TASK_1);
+
+--
+-- Add_Float
+--
+-- DESCRIPTION:
+--
+-- This method ensures the compilers thinks we are using the variables.
+--
+
+ function Add_Float(
+ n : in Float;
+ factor : in Float
+ ) return Float;
+ pragma Interface (C, Add_Float);
+ pragma Interface_Name (Add_Float, "add_float");
+
+end SPTEST;