diff options
-rw-r--r-- | test/Analysis/uninit-vals-ps.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Analysis/uninit-vals-ps.c b/test/Analysis/uninit-vals-ps.c new file mode 100644 index 0000000000..36db470de9 --- /dev/null +++ b/test/Analysis/uninit-vals-ps.c @@ -0,0 +1,18 @@ +// RUN: clang -checker-simple -verify %s + +struct FPRec { + void (*my_func)(int * x); +}; + +int bar(int x); + +int f1_a(struct FPRec* foo) { + int x; + (*foo->my_func)(&x); + return bar(x)+1; // no-warning +} + +int f1_b() { + int x; + return bar(x)+1; // expected-warning{{Pass-by-value argument in function is undefined.}} +} |