-fsanitize-coverage=control-flow does not sign entries into basic blocks on arm64e. This test compares a local pointer to a function [signed] with the basic block pointer. Because the entry into the
basic block is unsigned the addresses being compared are signed and unsigned, causing the path never to be taken.
This is a "bandaid" to get this test passing. We strip the signed bits from the pointer to the local functions so that the comparisons pass.
Filed radar: rdar://103042879 to note the behavior.
// blockaddress can not be used on function's entry block. if (&BB == &F.getEntryBlock()) CFs.push_back((Constant *)IRB.CreatePointerCast(&F, IntptrPtrTy)); else CFs.push_back((Constant *)IRB.CreatePointerCast(BlockAddress::get(&BB), IntptrPtrTy));
BlockAddress::get is responsible for signing the pointer.
Because of:
https://reviews.llvm.org/D133157
rdar://103042879