C++: add sanity test for side effect primaries

This commit is contained in:
Robert Marsh
2019-10-16 16:53:55 -07:00
parent dfed7502b6
commit fffe3c2432
11 changed files with 1609 additions and 0 deletions

View File

@@ -120,6 +120,13 @@ module InstructionSanity {
)
}
query predicate sideEffectWithoutPrimary(SideEffectInstruction instr, string message, IRFunction func, string funcText) {
not exists(instr.getPrimaryInstruction()) and
message = "Side effect instruction missing primary instruction in function $@" and
func = instr.getEnclosingIRFunction() and
funcText = Language::getIdentityString(func.getFunction())
}
/**
* Holds if an instruction, other than `ExitFunction`, has no successors.
*/

View File

@@ -120,6 +120,13 @@ module InstructionSanity {
)
}
query predicate sideEffectWithoutPrimary(SideEffectInstruction instr, string message, IRFunction func, string funcText) {
not exists(instr.getPrimaryInstruction()) and
message = "Side effect instruction missing primary instruction in function $@" and
func = instr.getEnclosingIRFunction() and
funcText = Language::getIdentityString(func.getFunction())
}
/**
* Holds if an instruction, other than `ExitFunction`, has no successors.
*/

View File

@@ -120,6 +120,13 @@ module InstructionSanity {
)
}
query predicate sideEffectWithoutPrimary(SideEffectInstruction instr, string message, IRFunction func, string funcText) {
not exists(instr.getPrimaryInstruction()) and
message = "Side effect instruction missing primary instruction in function $@" and
func = instr.getEnclosingIRFunction() and
funcText = Language::getIdentityString(func.getFunction())
}
/**
* Holds if an instruction, other than `ExitFunction`, has no successors.
*/