| 1 |
// RUN: %clang_analyze_cc1 %s \ |
| 2 |
// RUN: -analyzer-checker=core \ |
| 3 |
// RUN: -analyzer-checker=unix.StdCLibraryFunctions \ |
| 4 |
// RUN: -analyzer-config unix.StdCLibraryFunctions:ModelPOSIX=true \ |
| 5 |
// RUN: -analyzer-config unix.StdCLibraryFunctions:DisplayLoadedSummaries=true \ |
| 6 |
// RUN: -analyzer-checker=debug.ExprInspection \ |
| 7 |
// RUN: -analyzer-config eagerly-assume=false \ |
| 8 |
// RUN: -triple i686-unknown-linux 2>&1 | FileCheck %s --allow-empty |
| 9 |
|
| 10 |
// We test here the implementation of our summary API with Optional types. In |
| 11 |
// this TU we do not provide declaration for any of the functions that have |
| 12 |
// summaries. The implementation should be able to handle the nonexistent |
| 13 |
// declarations in a way that the summary is not added to the map. We expect no |
| 14 |
// crashes (i.e. no optionals should be 'dereferenced') and no output. |
| 15 |
|
| 16 |
// Must have at least one call expression to initialize the summary map. |
| 17 |
int bar(void); |
| 18 |
void foo(void) { |
| 19 |
bar(); |
| 20 |
} |
| 21 |
|
| 22 |
// CHECK-NOT: Loaded summary for: |