aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Analysis/std-c-library-functions-arg-constraints.cpp
blob: 037b5d9ad952089eea0b7994944ab55377010a15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: %clang_analyze_cc1 %s \
// RUN:   -analyzer-checker=core \
// RUN:   -analyzer-checker=unix.StdCLibraryFunctions \
// 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{{The 1st argument to '__defaultparam' is NULL but should not be NULL}}
}