Files
llvm-mingw/test
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
..
2019-03-12 10:42:43 +02:00
2019-12-20 09:43:39 +02:00
2020-09-16 00:03:57 +03:00
2020-09-16 00:03:57 +03:00
2018-06-05 23:40:25 +03:00
2018-10-17 22:45:54 +03:00