From a1f7d7d430466fe66ead3155a9015ddde237fd44 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 24 Jul 2018 09:00:18 +0200 Subject: score: RTEMS_PREDICT_TRUE(), RTEMS_PREDICT_FALSE() Add RTEMS_PREDICT_TRUE() and RTEMS_PREDICT_FALSE() for static branch prediction hints. Close #3475. --- testsuites/sptests/spmisc01/init.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'testsuites') diff --git a/testsuites/sptests/spmisc01/init.c b/testsuites/sptests/spmisc01/init.c index 4fab3f0e84..c406cd07aa 100644 --- a/testsuites/sptests/spmisc01/init.c +++ b/testsuites/sptests/spmisc01/init.c @@ -229,6 +229,31 @@ static void Init(rtems_task_argument arg) rtems_test_assert(RTEMS_XCONCAT(CON, CAT)() == 91); rtems_test_assert(strcmp(RTEMS_STRING(str), "str") == 0); rtems_test_assert(strcmp(RTEMS_XSTRING(STR), "ing") == 0); + + if (RTEMS_PREDICT_TRUE(true)) { + rtems_test_assert(true); + } else { + rtems_test_assert(false); + } + + if (RTEMS_PREDICT_FALSE(true)) { + rtems_test_assert(true); + } else { + rtems_test_assert(false); + } + + if (RTEMS_PREDICT_TRUE(false)) { + rtems_test_assert(false); + } else { + rtems_test_assert(true); + } + + if (RTEMS_PREDICT_FALSE(false)) { + rtems_test_assert(false); + } else { + rtems_test_assert(true); + } + TEST_END(); rtems_test_exit(0); } -- cgit v1.2.3