mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 14:26:42 +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).
30 lines
569 B
C
30 lines
569 B
C
// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core -verify %s
|
|
|
|
// For now, don't inline varargs.
|
|
void foo(int *x, ...) {
|
|
*x = 1;
|
|
}
|
|
|
|
void bar(void) {
|
|
foo(0, 2); // no-warning
|
|
}
|
|
|
|
// For now, don't inline vararg blocks.
|
|
void (^baz)(int *x, ...) = ^(int *x, ...) { *x = 1; };
|
|
|
|
void taz(void) {
|
|
baz(0, 2); // no-warning
|
|
}
|
|
|
|
// For now, don't inline global blocks.
|
|
void (^qux)(int *p) = ^(int *p) { *p = 1; };
|
|
void test_qux(void) {
|
|
qux(0); // no-warning
|
|
}
|
|
|
|
|
|
void test_analyzer_is_running(void) {
|
|
int *p = 0;
|
|
*p = 0xDEADBEEF; // expected-warning {{null}}
|
|
}
|