Changeset a1f7d7d in rtems for testsuites


Ignore:
Timestamp:
Jul 24, 2018, 7:00:18 AM (16 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
5677883
Parents:
406dd62
git-author:
Sebastian Huber <sebastian.huber@…> (07/24/18 07:00:18)
git-committer:
Sebastian Huber <sebastian.huber@…> (07/25/18 08:07:42)
Message:

score: RTEMS_PREDICT_TRUE(), RTEMS_PREDICT_FALSE()

Add RTEMS_PREDICT_TRUE() and RTEMS_PREDICT_FALSE() for static branch
prediction hints.

Close #3475.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/spmisc01/init.c

    r406dd62 ra1f7d7d  
    230230  rtems_test_assert(strcmp(RTEMS_STRING(str), "str") == 0);
    231231  rtems_test_assert(strcmp(RTEMS_XSTRING(STR), "ing") == 0);
     232
     233  if (RTEMS_PREDICT_TRUE(true)) {
     234    rtems_test_assert(true);
     235  } else {
     236    rtems_test_assert(false);
     237  }
     238
     239  if (RTEMS_PREDICT_FALSE(true)) {
     240    rtems_test_assert(true);
     241  } else {
     242    rtems_test_assert(false);
     243  }
     244
     245  if (RTEMS_PREDICT_TRUE(false)) {
     246    rtems_test_assert(false);
     247  } else {
     248    rtems_test_assert(true);
     249  }
     250
     251  if (RTEMS_PREDICT_FALSE(false)) {
     252    rtems_test_assert(false);
     253  } else {
     254    rtems_test_assert(true);
     255  }
     256
    232257  TEST_END();
    233258  rtems_test_exit(0);
Note: See TracChangeset for help on using the changeset viewer.