[cfe-commits] r50220 - /cfe/trunk/test/Analysis/uninit-vals-ps.c

Ted Kremenek kremenek at apple.com
Thu Apr 24 11:28:14 PDT 2008


Author: kremenek
Date: Thu Apr 24 13:28:14 2008
New Revision: 50220

URL: http://llvm.org/viewvc/llvm-project?rev=50220&view=rev
Log:
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>.

Added:
    cfe/trunk/test/Analysis/uninit-vals-ps.c

Added: cfe/trunk/test/Analysis/uninit-vals-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-vals-ps.c?rev=50220&view=auto

==============================================================================
--- cfe/trunk/test/Analysis/uninit-vals-ps.c (added)
+++ cfe/trunk/test/Analysis/uninit-vals-ps.c Thu Apr 24 13:28:14 2008
@@ -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.}}
+}





More information about the cfe-commits mailing list