1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,apiModeling.TrustReturnsNonnull -verify %s
3 int *foo() __attribute__((returns_nonnull
));
5 int *foo_no_attribute();
10 return *x
; // no-warning
13 int test_foo_no_attribute() {
14 int *x
= foo_no_attribute();
16 return *x
; // expected-warning{{Dereference of null pointer}}
19 void test(void *(*f
)(void)) {
20 f(); // Shouldn't crash compiler