Index: testsuites/samples/cdtest/cdtest.scn
===================================================================
--- testsuites/samples/cdtest/cdtest.scn	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ testsuites/samples/cdtest/cdtest.scn	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,43 +1,31 @@
-*** BEGIN OF TEST CONSTRUCTOR/DESTRUCTOR ***
-GLOBAL: Hey I'm in base class constructor number 1 for 0x2052154.
-GLOBAL: Hey I'm in base class constructor number 2 for 0x2052148.
-GLOBAL: Hey I'm in derived class constructor number 3 for 0x2052148.
+Hey I'm in base class constructor number 1 for 0x400010cc.
+Hey I'm in base class constructor number 2 for 0x400010d4.
+Hey I'm in derived class constructor number 3 for 0x400010d4.
 
 
-*** BEGIN OF TEST CONSTRUCTOR/DESTRUCTOR ***
-LOCAL: Hey I'm in base class constructor number 4 for 0x2057978.
-LOCAL: Hey I'm in base class constructor number 5 for 0x2057984.
-LOCAL: Hey I'm in base class constructor number 6 for 0x2057990.
-LOCAL: Hey I'm in base class constructor number 7 for 0x205799c.
-LOCAL: Hey I'm in derived class constructor number 8 for 0x205799c.
-IO Stream not tested
-LOCAL: Hey I'm in derived class destructor number 8 for 205799C.
+*** CONSTRUCTOR/DESTRUCTOR TEST ***
+Hey I'm in base class constructor number 4 for 0x4009ee08.
+Hey I'm in base class constructor number 5 for 0x4009ee10.
+Hey I'm in base class constructor number 6 for 0x4009ee18.
+Hey I'm in base class constructor number 7 for 0x4009ee20.
+Hey I'm in derived class constructor number 8 for 0x4009ee20.
+Testing a C++ I/O stream
+Hey I'm in derived class destructor number 8 for 0x4009ee20.
 Derived class - Instantiation order 8
-LOCAL: Hey I'm in base class destructor number 7 for 205799C.
-Derived class - Instantiation order 8
-LOCAL: Hey I'm in base class destructor number 6 for 2057990.
-Derived class - Instantiation order 6
-LOCAL: Hey I'm in base class destructor number 5 for 2057984.
-Derived class - Instantiation order 5
-LOCAL: Hey I'm in base class destructor number 4 for 2057978.
-Derived class - Instantiation order 5
-*** TESTING C++ EXCEPTIONS ***
+Hey I'm in base class destructor number 7 for 0x4009ee20.
+Instantiation order 8
+Hey I'm in base class destructor number 6 for 0x4009ee18.
+Instantiation order 6
+Hey I'm in base class destructor number 5 for 0x4009ee10.
+Instantiation order 5
+Hey I'm in base class destructor number 4 for 0x4009ee08.
+Instantiation order 5
+*** END OF CONSTRUCTOR/DESTRUCTOR TEST ***
 
-foo_function() catch block called:
-   < foo_function() throw this exception  >
-Success catching a char * exception
-foo_function() re-throwing execption...
-throw std::runtime: caught: thrown std::runtime object
-throw an instance based exception
-RtemsException raised=File:../../../../../../../rtems/c/src/../../testsuites/samples/cdtest/main.cc, Line:229, Error=55
-Success catching RtemsException...
-RtemsException ---> File:../../../../../../../rtems/c/src/../../testsuites/samples/cdtest/main.cc, Line:229, Error=55
-Exceptions are working properly.
-Global Dtors should be called after this line....
-GLOBAL: Hey I'm in derived class destructor number 3 for 2052148.
+
+Hey I'm in derived class destructor number 3 for 0x400010d4.
 Derived class - Instantiation order 3
-GLOBAL: Hey I'm in base class destructor number 2 for 2052148.
-Derived class - Instantiation order 3
-GLOBAL: Hey I'm in base class destructor number 1 for 2052154.
-Derived class - Instantiation order 1
-*** END OF TEST CONSTRUCTOR/DESTRUCTOR ***
+Hey I'm in base class destructor number 2 for 0x400010d4.
+Instantiation order 3
+Hey I'm in base class destructor number 1 for 0x400010cc.
+Instantiation order 1
Index: testsuites/samples/cdtest/init.c
===================================================================
--- testsuites/samples/cdtest/init.c	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ testsuites/samples/cdtest/init.c	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,36 +1,30 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- *  COPYRIGHT (c) 1989-2012.
+/*  Init
+ *
+ *  This routine is the initialization task for this test program.
+ *  It is called from init_exec and has the responsibility for creating
+ *  and starting the tasks that make up the test.  If the time of day
+ *  clock is required for the test, it should also be set to a known
+ *  value by this function.
+ *
+ *  Input parameters:  NONE
+ *
+ *  Output parameters:  NONE
+ *
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
  *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
  *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ *  $Id$
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define CONFIGURE_INIT
 #include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
 #include <stdio.h>
-#include <tmacros.h>
+#include "libcsupport.h"
Index: testsuites/samples/cdtest/main.cc
===================================================================
--- testsuites/samples/cdtest/main.cc	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ testsuites/samples/cdtest/main.cc	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,3 +1,4 @@
-/*
+/*  main
+ *
  *  This routine is the initialization task for this test program.
  *  It is called from init_exec and has the responsibility for creating
@@ -11,35 +12,26 @@
  *
  *  COPYRIGHT (c) 1994 by Division Incorporated
+ *
  *  Based in part on OAR works.
+ *  To anyone who acknowledges that this file is provided "AS IS"
+ *  without any express or implied warranty:
+ *      permission to use, copy, modify, and distribute this file
+ *      for any purpose is hereby granted without fee, provided that
+ *      the above copyright notice and this notice appears in all
+ *      copies, and that the name of Division Incorporated not be
+ *      used in advertising or publicity pertaining to distribution
+ *      of the software without specific, written prior permission.
+ *      Division Incorporated makes no representations about the
+ *      suitability of this software for any purpose.
  *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
- *
- *
- *  by Rosimildo da Silva:
- *  Modified the test a bit to indicate when an instance is
- *  global or not, and added code to test C++ exception.
+ *  $Id$
  */
 
 #include <rtems.h>
-#include <rtems/bspIo.h>
-#include <rtems/test-info.h>
-#include <rtems/sysinit.h>
+#include <stdio.h>
+#include <libcsupport.h>
+#include <iostream.h>
 
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <stdexcept>
-
-#ifdef RTEMS_TEST_IO_STREAM
-#include <iostream>
-#endif
-
-const char rtems_test_name[] = "CONSTRUCTOR/DESTRUCTOR";
-
-extern "C"
-{
-#include <tmacros.h>
+extern "C" {
 extern rtems_task main_task(rtems_task_argument);
 }
@@ -47,19 +39,13 @@
 static int num_inst = 0;
 
-static void check_end_of_test(void)
-{
-  if ( num_inst == 0 ) {
-    TEST_END();
-  }
-}
-
-class AClass {
+class A {
 public:
-  AClass(const char *p = "LOCAL" ) : ptr( p )
+    A(void)
     {
         num_inst++;
         printf(
-          "%s: Hey I'm in base class constructor number %d for %p.\n",
-          p, num_inst, this
+          "Hey I'm in base class constructor number %d for %p.\n",
+          num_inst,
+          this
         );
 
@@ -72,19 +58,14 @@
     };
 
-    virtual ~AClass()
+    virtual ~A()
     {
-	// MUST USE PRINTK -- RTEMS IS SHUTTING DOWN WHEN THIS RUNS
-        printk(
-          "%s: Hey I'm in base class destructor number %d for %p.\n",
-          ptr, num_inst, this
+        printf(
+          "Hey I'm in base class destructor number %d for %p.\n",
+          num_inst,
+          this
         );
-        printk("Derived class - %s\n", string);
+	print();
         num_inst--;
-        check_end_of_test();
     };
-
-#if __cplusplus >= 201103L
-    AClass& operator=(const AClass&) = default;
-#endif
 
     virtual void print()  { printf("%s\n", string); };
@@ -92,15 +73,15 @@
 protected:
     char  *string;
-    const char *ptr;
 };
 
-class BClass : public AClass {
+class B : public A {
 public:
-  BClass(const char *p = "LOCAL" ) : AClass( p )
+    B(void)
     {
         num_inst++;
         printf(
-          "%s: Hey I'm in derived class constructor number %d for %p.\n",
-          p, num_inst,  this
+          "Hey I'm in derived class constructor number %d for %p.\n",
+          num_inst,
+          this
         );
 
@@ -113,14 +94,13 @@
     };
 
-    ~BClass()
+    ~B()
     {
-        printk(
-          "%s: Hey I'm in derived class destructor number %d for %p.\n",
-          ptr, num_inst,
+        printf(
+          "Hey I'm in derived class destructor number %d for %p.\n",
+          num_inst,
           this
         );
-        printk("Derived class - %s\n", string);
+	      print();
         num_inst--;
-        check_end_of_test();
     };
 
@@ -129,46 +109,16 @@
 
 
-class RtemsException
-{
-public:
-
-    RtemsException( const char *module, int ln, int err = 0 )
-    : error( err ), line( ln ), file( module )
-    {
-      printf( "RtemsException raised=File:%s, Line:%d, Error=%X\n",
-               file, line, error );
-    }
-
-    void show()
-    {
-      printf( "RtemsException ---> File:%s, Line:%d, Error=%X\n",
-               file, line, error );
-    }
-
-private:
-   int  error;
-   int  line;
-   const char *file;
-
-};
-
-
-
-AClass foo( "GLOBAL" );
-BClass foobar( "GLOBAL" );
+A foo;
+B foobar;
 
 void
 cdtest(void)
 {
-    AClass bar, blech, blah;
-    BClass bleak;
+    A bar, blech, blah;
+    B bleak;
 
-#ifdef RTEMS_TEST_IO_STREAM
-    std::cout << "Testing a C++ I/O stream" << std::endl;
-#else
-    printf("IO Stream not tested\n");
-#endif
+    cout << "Testing a C++ I/O stream" << endl;
+
     bar = blech;
-    rtems_task_wake_after( 5 * rtems_clock_get_ticks_per_second() );
 }
 
@@ -179,108 +129,18 @@
 //      run.
 //
+//      Ref: c/src/lib/libbsp/hppa1_1/simhppa/startup/bspstart.c
+//
 
-static void foo_function()
-{
-    try
-    {
-      throw "foo_function() throw this exception";
-    }
-    catch( const char *e )
-    {
-     printf( "foo_function() catch block called:\n   < %s  >\n", e );
-     throw "foo_function() re-throwing execption...";
-    }
-}
 
 rtems_task main_task(
-  rtems_task_argument
+  rtems_task_argument ignored
 )
 {
+    printf( "\n\n*** CONSTRUCTOR/DESTRUCTOR TEST ***\n" );
+
     cdtest();
 
-    printf( "*** TESTING C++ EXCEPTIONS ***\n\n" );
+    printf( "*** END OF CONSTRUCTOR/DESTRUCTOR TEST ***\n\n\n" );
 
-    try
-    {
-      foo_function();
-    }
-    catch( const char *e )
-    {
-       printf( "Success catching a char * exception\n%s\n", e );
-    }
-
-    try
-    {
-      throw std::runtime_error("thrown std::runtime object");
-    }
-    catch (std::exception const& e)
-    {
-       printf("throw std::runtime: caught: %s\n", e.what());
-    }
-
-    try
-    {
-      printf( "throw an instance based exception\n" );
-		throw RtemsException( __FILE__, __LINE__, 0x55 );
-    }
-    catch( RtemsException & ex )
-    {
-       printf( "Success catching RtemsException...\n" );
-       ex.show();
-    }
-    catch(...)
-    {
-      printf( "Caught another exception.\n" );
-    }
-    printf( "Exceptions are working properly.\n" );
-    rtems_task_wake_after( 5 * rtems_clock_get_ticks_per_second() );
-    printf( "Global Dtors should be called after this line....\n" );
     exit(0);
 }
-
-/*
- * Exceptions during system initialization work only on targets which do not
- * need a registration of exception frames during the global construction.  In
- * particular, targets which use the DWARF2 unwinder cannot use exceptions
- * during system initialization.
- */
-#if defined(__arm__)
-#define CAN_DO_EXCEPTIONS_DURING_SYSINIT
-#endif
-
-#ifdef CAN_DO_EXCEPTIONS_DURING_SYSINIT
-static void early_exception()
-{
-    try
-    {
-      throw "early exception";
-    }
-    catch( const char *e )
-    {
-      rtems_test_assert(strcmp(e, "early exception") == 0);
-      throw "early exception 2";
-    }
-}
-#endif
-
-static void test_exceptions_during_system_init()
-{
-    TEST_BEGIN();
-
-#ifdef CAN_DO_EXCEPTIONS_DURING_SYSINIT
-    try
-    {
-      early_exception();
-    }
-    catch( const char *e )
-    {
-      rtems_test_assert(strcmp(e, "early exception 2") == 0);
-    }
-#endif
-}
-
-RTEMS_SYSINIT_ITEM(
-    test_exceptions_during_system_init,
-    RTEMS_SYSINIT_IDLE_THREADS,
-    RTEMS_SYSINIT_ORDER_LAST
-);
Index: testsuites/samples/cdtest/system.h
===================================================================
--- testsuites/samples/cdtest/system.h	(revision d6afec1859b2a589da52a0d26111affa0b6a1662)
+++ testsuites/samples/cdtest/system.h	(revision ac7d5ef06a6d6e8d84abbd1f0b82162725f98326)
@@ -1,4 +1,2 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
 /*  system.h
  *
@@ -6,59 +4,27 @@
  *  function in the test set.
  *
- *  COPYRIGHT (c) 1989-1999.
+ *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
  *  On-Line Applications Research Corporation (OAR).
+ *  All rights assigned to U.S. Government, 1994.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
+ *  This material may be reproduced by or for the U.S. Government pursuant
+ *  to the copyright license under the clause at DFARS 252.227-7013.  This
+ *  notice must appear in all copies of this file and its derivatives.
  *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ *  $Id$
  */
 
 #include <rtems.h>
-#include <rtems/test-info.h>
+#include "stdio.h"
 
-/* functions */
+/* Miscellaneous */
 
-rtems_task main_task(
-  rtems_task_argument argument
-);
+#define EXTERN  extern             /* external definition */
 
-/* configuration information */
+/* macros */
 
-#include <bsp.h> /* for device driver prototypes */
+/* structures */
 
-#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
-#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
-
-#define CONFIGURE_MAXIMUM_TASKS           1
-#define CONFIGURE_MAXIMUM_SEMAPHORES      5
-
-#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-#define CONFIGURE_INIT_TASK_ENTRY_POINT   main_task
-#define CONFIGURE_INIT_TASK_NAME          rtems_build_name( 'C', 'T', 'O', 'R' )
-#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
-
-/* On some platforms _Unwind_RaiseException() needs a lot of stack space */
-#define CONFIGURE_INIT_TASK_STACK_SIZE (4 * RTEMS_MINIMUM_STACK_SIZE)
-
-#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
-
-#include <rtems/confdefs.h>
+#include "gvar.h"
 
 /* end of include file */
