summaryrefslogtreecommitdiff
path: root/lib/bitmap.c
diff options
context:
space:
mode:
authorAlexander Lobakin <alexandr.lobakin@intel.com>2022-06-24 14:13:13 +0200
committerYury Norov <yury.norov@gmail.com>2022-06-30 19:52:42 -0700
commitdc34d5036692c614eef23c1130ee42a201c316bf (patch)
tree8dc42f556d9169303817bc01628478d79a7507b6 /lib/bitmap.c
parent3e7e5baaaba78075a7f3a57432609e363bf2a486 (diff)
lib: test_bitmap: add compile-time optimization/evaluations assertions
Add a function to the bitmap test suite, which will ensure that compilers are able to evaluate operations performed by the bitops/bitmap helpers to compile-time constants when all of the arguments are compile-time constants as well, or trigger a build bug otherwise. This should work on all architectures and all the optimization levels supported by Kbuild. The function doesn't perform any runtime tests and gets optimized out to nothing after passing the build assertions. Unfortunately, Clang for s390 is currently broken (up to the latest Git snapshots) -- see the comment in the code -- so for now there's a small workaround for it which doesn't alter the logics. Hope we'll be able to remove it one day (bugreport is on its way). Suggested-by: Yury Norov <yury.norov@gmail.com> Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Yury Norov <yury.norov@gmail.com>
Diffstat (limited to 'lib/bitmap.c')
0 files changed, 0 insertions, 0 deletions