From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Analysis/inline-not-supported.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 clang/test/Analysis/inline-not-supported.c (limited to 'clang/test/Analysis/inline-not-supported.c') diff --git a/clang/test/Analysis/inline-not-supported.c b/clang/test/Analysis/inline-not-supported.c new file mode 100644 index 0000000..bff0e4d --- /dev/null +++ b/clang/test/Analysis/inline-not-supported.c @@ -0,0 +1,29 @@ +// RUN: %clang_cc1 -fblocks -analyze -analyzer-checker=core -analyzer-ipa=inlining -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}} +} -- cgit v1.2.3