[analyzer] StdLibraryFunctionsChecker: Add test for function with default parameter
Reviewers: Szelethus, baloghadamsoftware, gamesh411, steakhal, balazske
Subscribers: whisperity, xazax.hun, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77411
2020-04-03 23:56:28 +08:00
|
|
|
// RUN: %clang_analyze_cc1 %s \
|
|
|
|
// RUN: -analyzer-checker=core \
|
|
|
|
// RUN: -analyzer-checker=apiModeling.StdCLibraryFunctions \
|
2020-05-27 18:27:32 +08:00
|
|
|
// RUN: -analyzer-checker=alpha.unix.StdCLibraryFunctionArgs \
|
[analyzer] StdLibraryFunctionsChecker: Add test for function with default parameter
Reviewers: Szelethus, baloghadamsoftware, gamesh411, steakhal, balazske
Subscribers: whisperity, xazax.hun, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77411
2020-04-03 23:56:28 +08:00
|
|
|
// RUN: -analyzer-checker=debug.StdCLibraryFunctionsTester \
|
|
|
|
// RUN: -analyzer-checker=debug.ExprInspection \
|
|
|
|
// RUN: -analyzer-config eagerly-assume=false \
|
|
|
|
// RUN: -triple i686-unknown-linux \
|
|
|
|
// RUN: -verify
|
|
|
|
|
|
|
|
void clang_analyzer_eval(int);
|
|
|
|
|
|
|
|
int __defaultparam(void *, int y = 3);
|
|
|
|
|
|
|
|
void test_arg_constraint_on_fun_with_default_param() {
|
|
|
|
__defaultparam(nullptr); // \
|
|
|
|
// expected-warning{{Function argument constraint is not satisfied}}
|
|
|
|
}
|