return makeNonLoc(Sym, BO_NE, BVF.getValue(0, Sym->getType()), castTy);
}
- assert(val.getAs<Loc>());
+ assert(val.getAs<Loc>() || val.getAs<nonloc::LocAsInteger>());
return makeTruthVal(true, castTy);
}
// RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core -analyzer-store=region -verify %s
// expected-no-diagnostics
-// Test function pointer casts. Currently we track function addresses using
-// loc::FunctionVal. Because casts can be arbitrary, do we need to model
-// functions with regions?
+// Test function pointer casts.
typedef void* (*MyFuncTest1)(void);
MyFuncTest1 test1_aux(void);
if (p != ((void*) 0)) x = (*p)();
}
-// Test casts from void* to function pointers. Same issue as above:
-// should we eventually model function pointers using regions?
+// Test casts from void* to function pointers.
void* test2(void *p) {
MyFuncTest1 fp = (MyFuncTest1) p;
return (*fp)();
{
InObj.elem |= EEOne;
}
+
+
+// PR16690
+_Bool testLocAsIntegerToBool() {
+ return (long long)&testLocAsIntegerToBool;
+}