Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Analysis / std-c-library-functions-restrict.c
blob27e223c6e5b2f27df74b6c2ff9bb63b21c97caeb
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 %s
8 // The signatures for these functions are the same and they specify their
9 // parameter with the restrict qualifier. In C, the signature should match only
10 // if the restrict qualifier is there on the parameter. Thus, the summary
11 // should be loaded for the last two declarations only.
12 void __test_restrict_param_0(void *p);
13 void __test_restrict_param_1(void *__restrict p);
14 void __test_restrict_param_2(void *restrict p);
16 // CHECK-NOT: Loaded summary for: void __test_restrict_param_0
17 // CHECK: Loaded summary for: void __test_restrict_param_1(void *restrict p)
18 // CHECK: Loaded summary for: void __test_restrict_param_2(void *restrict p)
20 // Must have at least one call expression to initialize the summary map.
21 int bar(void);
22 void foo(void) {
23 bar();