// RUN: %clang_analyze_cc1 -fexceptions -fobjc-exceptions -fcxx-exceptions -analyzer-checker=core,unix.Malloc,debug.ExprInspection -verify %s
voidclang_analyzer_checkInlined(bool);typedeftypeof(sizeof(int))size_t;void*malloc(size_t);voidfree(void*);id getException();voidinlinedObjC(){clang_analyzer_checkInlined(true);// expected-warning{{TRUE}}
@throwgetException();}inttestObjC(){int a;// uninitialized
void*mem =malloc(4);// no-warning (ObjC exceptions are usually fatal)
inlinedObjC();free(mem);return a;// no-warning
}voidinlinedCXX(){clang_analyzer_checkInlined(true);// expected-warning{{TRUE}}
throw-1;}inttestCXX(){int a;// uninitialized
// FIXME: this should be reported as a leak, because C++ exceptions are
// often not fatal.
void*mem =malloc(4);inlinedCXX();free(mem);return a;// no-warning
}