summaryrefslogtreecommitdiffstats
path: root/testsuites/libtests/dl02
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2019-02-02 15:09:53 +1100
committerChris Johns <chrisj@rtems.org>2019-02-09 10:06:34 +1100
commit6c9f0176a916cdbe88e04417e7aa1405d80c500f (patch)
tree1846dd800a123e682f15e49a893426a9a6a064c4 /testsuites/libtests/dl02
parentlibdl: Add support for large memory programs (diff)
downloadrtems-6c9f0176a916cdbe88e04417e7aa1405d80c500f.tar.bz2
libdl: Add powerpc large memory and small data support.
- Add support for architecure sections that can be handled by the architecture back end. - Add trampoline/fixup support for PowerPC. This means the PowerPC now supports large memory loading of applications. - Add a bit allocator to manage small block based regions of memory. - Add small data (sdata/sbss) support for the PowerPC. The support makes the linker allocated small data region of memory a global resource available to libdl loaded object files. Updates #3687 Updates #3685
Diffstat (limited to 'testsuites/libtests/dl02')
-rw-r--r--testsuites/libtests/dl02/dl-load.c16
-rw-r--r--testsuites/libtests/dl02/dl-o1.c10
-rw-r--r--testsuites/libtests/dl02/dl-o2.c10
3 files changed, 26 insertions, 10 deletions
diff --git a/testsuites/libtests/dl02/dl-load.c b/testsuites/libtests/dl02/dl-load.c
index 0fa897d5a0..2e76c2dea6 100644
--- a/testsuites/libtests/dl02/dl-load.c
+++ b/testsuites/libtests/dl02/dl-load.c
@@ -15,8 +15,14 @@
#include <rtems/rtl/rtl-shell.h>
#include <rtems/rtl/rtl-trace.h>
-#define DL02_DEBUG_TRACE 0 /* RTEMS_RTL_TRACE_ALL */
-#define DL02_RTL_CMDS 0
+#define TEST_TRACE 0
+#if TEST_TRACE
+ #define DL_DEBUG_TRACE (RTEMS_RTL_TRACE_ALL & ~RTEMS_RTL_TRACE_ALLOCATOR)
+ #define DL_RTL_CMDS 1
+#else
+ #define DL_DEBUG_TRACE 0
+ #define DL_RTL_CMDS 0
+#endif
typedef int (*call_t)(int argc, const char* argv[]);
@@ -55,8 +61,8 @@ int dl_load_test(void)
int call_ret;
int ret;
-#if DL02_DEBUG_TRACE
- rtems_rtl_trace_set_mask (DL02_DEBUG_TRACE);
+#if DL_DEBUG_TRACE
+ rtems_rtl_trace_set_mask (DL_DEBUG_TRACE);
#endif
o1 = dl_load_obj("/dl02-o1.o");
@@ -66,7 +72,7 @@ int dl_load_test(void)
if (!o1)
return 1;
-#if DL02_RTL_CMDS
+#if DL_RTL_CMDS
{
char* list[] = { "rtl", "list", NULL };
rtems_rtl_shell_command (2, list);
diff --git a/testsuites/libtests/dl02/dl-o1.c b/testsuites/libtests/dl02/dl-o1.c
index a4355d6e37..2afb618800 100644
--- a/testsuites/libtests/dl02/dl-o1.c
+++ b/testsuites/libtests/dl02/dl-o1.c
@@ -36,9 +36,12 @@ static int dl_o1_callback(const char* message, int count)
*/
int rtems_main (int argc, const char* argv[]);
+#define PDOUBLE(_d) ((int) (_d)), (int) ((_d) * 100.0) % 100
+
int rtems_main (int argc, const char* argv[])
{
func1_t f1;
+ double f2_ret;
int arg;
int ret;
@@ -56,9 +59,12 @@ int rtems_main (int argc, const char* argv[])
return 0;
}
- if (dl_o2_func2 (7.1, 33.0) != (7.1 * 33.0))
+ f2_ret = dl_o2_func2 (7.1, 33.0);
+ printf("rtems_main: dl_o2_func2 returned: %d.%02d\n",
+ PDOUBLE(f2_ret));
+ if (f2_ret != (7.1 * 33.0))
{
- printf("rtems_main: dl_o2_func1 returned bad value\n");
+ printf("rtems_main: dl_o2_func2 returned a bad\n");
return 0;
}
diff --git a/testsuites/libtests/dl02/dl-o2.c b/testsuites/libtests/dl02/dl-o2.c
index 4c1a918dea..507333535b 100644
--- a/testsuites/libtests/dl02/dl-o2.c
+++ b/testsuites/libtests/dl02/dl-o2.c
@@ -10,7 +10,7 @@
#include <rtems/test.h>
-#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__);
+#define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__)
int dl_o2_func1 (int argc, char* argv[])
{
@@ -21,13 +21,17 @@ int dl_o2_func1 (int argc, char* argv[])
return argc;
}
+#define PDOUBLE(_d) ((int) (_d)), (int) (((_d) + 0.005) * 100.0) % 100
+
double dl_o2_func2 (double d1, double d2)
{
- return d1 * d2;
+ double ret = d1 * d2;
+ printf("dl_o2_func2: d1=%d.%02d d2=%d.%d ret=%d.%02d\n",
+ PDOUBLE(d1), PDOUBLE(d2), PDOUBLE(ret));
+ return ret;
}
int dl_o2_func3 (dl_o2_call_t callback, int count)
{
return callback ("string in dl_o2", count + 1);
}
-