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