Commit Graph

4 Commits

Author SHA1 Message Date
Martin Storsjö a453b3c9b3 test: Skip inline x86_64 assembly on arm64ec 2025-05-18 22:30:20 +03:00
Martin Storsjö 8a7c59dc94 test: Avoid the compiler optimizing out the cfguard check call
When calling make_indirect_call with a parameter which is known,
Clang, since the 18.x release, can end up producing a specialized
version of the function which omits the cfguard check call (as the
target is known) and calls the known target directly.

The function is marked with a noinline attribute, to avoid
the compiler optimizing out the cfguard check call when the
target is known, but even with a noinline function, the compiler
apparently can make a separate specialized version of it.

To avoid the compiler doing such optimizations, reference the
target function via a global variable - the compiler can't assume
anything about the contents of them (they could be altered between
initialization and reading them later).

This fixes the cfguard invalid_icall test with Clang 18.x, when
compiled with optimizations enabled.
2024-03-14 23:11:45 +02:00
Martin Storsjö 04edd84e9d test: Return 0 if cfguard-test is executed without arguments
This simplifies bare-bones testing of just executing all built
executables without an argument.
2022-10-04 11:51:12 +03:00
Alvin Wong 039ee72a68 Add CFGuard test 2022-10-01 13:25:52 +03:00