I localized the source of the fail in Verifier::visitGlobalVariable function during:
840 if (GV.hasName() && (GV.getName() == "llvm.global_ctors" ||
841 GV.getName() == "llvm.global_dtors")) {
842 Check(!GV.hasInitializer() || GV.hasAppendingLinkage(),
843 "invalid linkage for intrinsic global variable", &GV);
844 Check(GV.materialized_use_empty(),
845 "invalid uses of intrinsic global variable", &GV);
It sets Broken variable to true in Check(GV.materialized_use_empty() which checks if UseList == nullptr if not it fails.
I checked the same example with X86 backend and it works without fail.
Reproducer
example.cpp
Stack Trace
Additional info
I localized the source of the fail in
Verifier::visitGlobalVariable
function during:It sets Broken variable to true in
Check(GV.materialized_use_empty()
which checks ifUseList == nullptr
if not it fails. I checked the same example with X86 backend and it works without fail.IR
Current trunk - followed reproducer above: