26 lines · cpp
1// RUN: %clang_analyze_cc1 %s \2// RUN: -analyzer-checker=core \3// RUN: -analyzer-checker=unix.StdCLibraryFunctions \4// RUN: -analyzer-checker=debug.StdCLibraryFunctionsTester \5// RUN: -analyzer-config unix.StdCLibraryFunctions:DisplayLoadedSummaries=true \6// RUN: -triple i686-unknown-linux 2>&1 | FileCheck %s7 8// The signatures for these functions are the same and they specify their9// parameter with the restrict qualifier. In C++, however, we are more10// indulgent and we do not match based on this qualifier. Thus, the given11// signature should match for both of the declarations below, i.e the summary12// should be loaded for both of them.13void __test_restrict_param_0(void *p);14void __test_restrict_param_1(void *__restrict p);15// The below declaration is illegal, "restrict" is not a keyword in C++.16// void __test_restrict_param_2(void *restrict p);17 18// CHECK: Loaded summary for: void __test_restrict_param_0(void *p)19// CHECK: Loaded summary for: void __test_restrict_param_1(void *__restrict p)20 21// Must have at least one call expression to initialize the summary map.22int bar(void);23void foo() {24 bar();25}26