fix off by 1 (insn) error in eh.sjlj.setjmp thumb code sequence.
[oota-llvm.git] / unittests / VMCore / InstructionsTest.cpp
index 054193f31ee7bf4f63d06a0ca72825b19e548627..c1baa74487aa75d7679c701a636979433f026f52 100644 (file)
@@ -11,6 +11,7 @@
 #include "llvm/BasicBlock.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/LLVMContext.h"
+#include "llvm/ADT/STLExtras.h"
 #include "gtest/gtest.h"
 
 namespace llvm {
@@ -58,9 +59,9 @@ TEST(InstructionsTest, BranchInst) {
   EXPECT_EQ(b0->getNumOperands(), 1U);
 
   EXPECT_NE(b0->op_begin(), b0->op_end());
-  EXPECT_EQ(b0->op_begin() + 1, b0->op_end());
+  EXPECT_EQ(next(b0->op_begin()), b0->op_end());
 
-  EXPECT_EQ(b0->op_begin() + 1, b0->op_end());
+  EXPECT_EQ(next(b0->op_begin()), b0->op_end());
 
   const IntegerType* Int1 = IntegerType::get(C, 1);
   Constant* One = ConstantInt::get(Int1, 1, true);