brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 27e223c Raw
25 lines · c
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, the signature should match only10// if the restrict qualifier is there on the parameter. Thus, the summary11// should be loaded for the last two declarations only.12void __test_restrict_param_0(void *p);13void __test_restrict_param_1(void *__restrict p);14void __test_restrict_param_2(void *restrict p);15 16// CHECK-NOT: Loaded summary for: void __test_restrict_param_017//     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)19 20// Must have at least one call expression to initialize the summary map.21int bar(void);22void foo(void) {23  bar();24}25