1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[NFC] Remove some GCC warning from c9e93c84f61400d1aac7d195a0578e80bc48c69a

This commit is contained in:
Tyker 2020-02-22 14:11:31 +01:00
parent 0ba63b8a56
commit 59261f7b76
2 changed files with 9 additions and 6 deletions

View File

@ -229,8 +229,8 @@ bool llvm::hasAttributeInAssume(CallInst &AssumeCI, Value *IsOn,
Lookup->Tag->getKey() != AttrName)
return false;
if (IsOn) {
if (Lookup->End - Lookup->Begin < BOIE_WasOn)
return false;
assert((Lookup->End - Lookup->Begin > BOIE_WasOn) &&
"missing argument of attribute");
while (true) {
if (Lookup == Assume.bundle_op_info_end() ||
Lookup->Tag->getKey() != AttrName)

View File

@ -51,8 +51,9 @@ void AssertMatchesExactlyAttributes(CallInst *Assume, Value *WasOn,
#include "llvm/IR/Attributes.inc"
}) {
bool ShouldHaveAttr = Reg.match(Attr, &Matches) && Matches[0] == Attr;
if (ShouldHaveAttr != hasAttributeInAssume(*Assume, WasOn, Attr))
if (ShouldHaveAttr != hasAttributeInAssume(*Assume, WasOn, Attr)) {
ASSERT_TRUE(false);
}
}
}
@ -71,10 +72,12 @@ void AssertHasTheRightValue(CallInst *Assume, Value *WasOn,
AssumeQuery::Lowest);
bool ResultHigh = hasAttributeInAssume(*Assume, WasOn, Kind, &ArgValHigh,
AssumeQuery::Highest);
if (ResultLow != ResultHigh)
if (ResultLow != ResultHigh || ResultHigh == false) {
ASSERT_TRUE(false);
if (ArgValLow != Value || ArgValLow != ArgValHigh)
ASSERT_EQ(ArgValLow, Value);
}
if (ArgValLow != Value || ArgValLow != ArgValHigh) {
ASSERT_TRUE(false);
}
}
TEST(AssumeQueryAPI, Basic) {