mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-30 06:26:07 +00:00

without prototypes. This patch converts the function signatures to have a prototype for the situations where the test is not specific to K&R C declarations. e.g., void func(); becomes void func(void); This is the ninth batch of tests being updated (there are a significant number of other tests left to be updated).
25 lines
1.1 KiB
C
25 lines
1.1 KiB
C
// RUN: %clang_analyze_cc1 %s \
|
|
// RUN: -analyzer-checker=core \
|
|
// RUN: -analyzer-checker=apiModeling.StdCLibraryFunctions \
|
|
// RUN: -analyzer-checker=debug.StdCLibraryFunctionsTester \
|
|
// RUN: -analyzer-config apiModeling.StdCLibraryFunctions:DisplayLoadedSummaries=true \
|
|
// RUN: -triple i686-unknown-linux 2>&1 | FileCheck %s
|
|
|
|
// The signatures for these functions are the same and they specify their
|
|
// parameter with the restrict qualifier. In C, the signature should match only
|
|
// if the restrict qualifier is there on the parameter. Thus, the summary
|
|
// should be loaded for the last two declarations only.
|
|
void __test_restrict_param_0(void *p);
|
|
void __test_restrict_param_1(void *__restrict p);
|
|
void __test_restrict_param_2(void *restrict p);
|
|
|
|
// CHECK-NOT: Loaded summary for: void __test_restrict_param_0
|
|
// CHECK: Loaded summary for: void __test_restrict_param_1(void *restrict p)
|
|
// CHECK: Loaded summary for: void __test_restrict_param_2(void *restrict p)
|
|
|
|
// Must have at least one call expression to initialize the summary map.
|
|
int bar(void);
|
|
void foo(void) {
|
|
bar();
|
|
}
|