Commit 837d8129 authored by Tyker's avatar Tyker
Browse files

[NFC] Remove some GCC warning from c9e93c84

parent a6370d57
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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)
+7 −4
Original line number Diff line number Diff line
@@ -51,10 +51,11 @@ 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);
    }
  }
}

void AssertHasTheRightValue(CallInst *Assume, Value *WasOn,
                            Attribute::AttrKind Kind, unsigned Value, bool Both,
@@ -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_TRUE(false);
  if (ArgValLow != Value || ArgValLow != ArgValHigh)
    ASSERT_EQ(ArgValLow, Value);
  }
}

TEST(AssumeQueryAPI, Basic) {