xref: /llvm-project/clang/test/Analysis/inline-not-supported.c (revision 1ea584377e7897f7df5302ed9cd378d17be14fbf)
1 // RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core -verify %s
2 
3 // For now, don't inline varargs.
foo(int * x,...)4 void foo(int *x, ...) {
5   *x = 1;
6 }
7 
bar(void)8 void bar(void) {
9   foo(0, 2); // no-warning
10 }
11 
12 // For now, don't inline vararg blocks.
13 void (^baz)(int *x, ...) = ^(int *x, ...) { *x = 1; };
14 
taz(void)15 void taz(void) {
16   baz(0, 2); // no-warning
17 }
18 
19 // For now, don't inline global blocks.
20 void (^qux)(int *p) = ^(int *p) { *p = 1; };
test_qux(void)21 void test_qux(void) {
22   qux(0); // no-warning
23 }
24 
25 
test_analyzer_is_running(void)26 void test_analyzer_is_running(void) {
27   int *p = 0;
28   *p = 0xDEADBEEF; // expected-warning {{null}}
29 }
30