mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-22 21:15:40 -04:00

Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when invoking static analyzer, and perform runtime substitution to select the appropriate constraint manager, per D28952. Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D30373 llvm-svn: 296895
30 lines
553 B
C
30 lines
553 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() {
|
|
foo(0, 2); // no-warning
|
|
}
|
|
|
|
// For now, don't inline vararg blocks.
|
|
void (^baz)(int *x, ...) = ^(int *x, ...) { *x = 1; };
|
|
|
|
void taz() {
|
|
baz(0, 2); // no-warning
|
|
}
|
|
|
|
// For now, don't inline global blocks.
|
|
void (^qux)(int *p) = ^(int *p) { *p = 1; };
|
|
void test_qux() {
|
|
qux(0); // no-warning
|
|
}
|
|
|
|
|
|
void test_analyzer_is_running() {
|
|
int *p = 0;
|
|
*p = 0xDEADBEEF; // expected-warning {{null}}
|
|
}
|