diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-02-09 21:59:52 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-02-09 21:59:52 +0000 |
commit | 482080a621897ce83e8c1edfbfc1265bb13b8424 (patch) | |
tree | d3bc86c083d270b39ca11d542ff50d8152743967 /clang/test/Analysis/inline-not-supported.c | |
parent | 29082a5f1d02157098f0b321c4ca57f274e63c17 (diff) | |
download | bcm5719-llvm-482080a621897ce83e8c1edfbfc1265bb13b8424.tar.gz bcm5719-llvm-482080a621897ce83e8c1edfbfc1265bb13b8424.zip |
[analyzer] Proactively avoid inlining vararg functions and blocks until we properly support them.
llvm-svn: 150207
Diffstat (limited to 'clang/test/Analysis/inline-not-supported.c')
-rw-r--r-- | clang/test/Analysis/inline-not-supported.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/test/Analysis/inline-not-supported.c b/clang/test/Analysis/inline-not-supported.c new file mode 100644 index 00000000000..0bde6f7e21d --- /dev/null +++ b/clang/test/Analysis/inline-not-supported.c @@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -fblocks -analyze -analyzer-checker=core -analyzer-inline-call -analyzer-store region -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 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}} +} |