lib/tests: randstruct: Add deep function pointer layout test
authorKees Cook <kees@kernel.org>
Fri, 2 May 2025 22:41:20 +0000 (15:41 -0700)
committerKees Cook <kees@kernel.org>
Thu, 8 May 2025 16:42:40 +0000 (09:42 -0700)
commitf55aef7e0cc7583062cbda9becaa3b2ba3255fa3
treee7355e3243396e6089fcb04c67ea52ff1232b6d7
parentb370f7eacdcfe1dd17bee00506296aa3fdc773cb
lib/tests: randstruct: Add deep function pointer layout test

The recent fix in commit c2ea09b193d2 ("randstruct: gcc-plugin: Remove
bogus void member") has fixed another issue: it was not always detecting
composite structures made only of function pointers and structures of
function pointers. Add a test for this case, and break out the layout
tests since this issue is actually a problem for Clang as well[1].

Link: https://github.com/llvm/llvm-project/issues/138355
Link: https://lore.kernel.org/r/20250502224116.work.591-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
lib/tests/randstruct_kunit.c