Various bug fixes and new tests.

Amusingly realized that many tests believed to be passing were in fact not
running at all.  The test harness returned 0 if the test wasn't run, but some
of the tests used 0 as a success code.  Will change the tests later.

Most were failing only because the function pointer table in Thread wasn't
fully initialized with the math helper functions.

Change-Id: If2e42f06139f219a423eef475b599258ccfc82d4
diff --git a/src/compiler/codegen/arm/Assemble.cc b/src/compiler/codegen/arm/Assemble.cc
index 19b9445..d9dd8c4 100644
--- a/src/compiler/codegen/arm/Assemble.cc
+++ b/src/compiler/codegen/arm/Assemble.cc
@@ -1194,13 +1194,18 @@
         } else if (lir->opcode == kThumbBCond ||
                    lir->opcode == kThumb2BCond) {
             ArmLIR *targetLIR = (ArmLIR *) lir->generic.target;
-            intptr_t pc = lir->generic.offset + 4;
-            intptr_t target = targetLIR->generic.offset;
-            int delta = target - pc;
-            if ((lir->opcode == kThumbBCond) && (delta > 254 || delta < -256)) {
-                lir->opcode = kThumb2BCond;
-                oatSetupResourceMasks(lir);
-                res = kRetryAll;
+            int delta = 0;
+            if (targetLIR == NULL) {
+                UNIMPLEMENTED(WARNING) << "Throw targets unimplemented";
+            } else {
+                intptr_t pc = lir->generic.offset + 4;
+                intptr_t target = targetLIR->generic.offset;
+                delta = target - pc;
+                if ((lir->opcode == kThumbBCond) && (delta > 254 || delta < -256)) {
+                    lir->opcode = kThumb2BCond;
+                    oatSetupResourceMasks(lir);
+                    res = kRetryAll;
+                }
             }
             lir->operands[0] = delta >> 1;
         } else if (lir->opcode == kThumb2BUncond) {