aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-24 18:28:14 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-24 18:28:14 +0000
commit43ae4b0d2ba2a7de1c3ccb25f22955489999e1fb (patch)
tree9654914f3c40d0ab10f472b10e2498879a180c99
parent08e48c1affba118c236e20feeb053fb5bb8e8ca4 (diff)
Added uninitialized-values (path-sensitive) test case as a regression test
for the fix in r50178 (http://llvm.org/viewvc/llvm-project?rev=50178&view=rev). This fix was for <rdar://problem/5881148>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50220 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/uninit-vals-ps.c18
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.}}
+}