[cfe-commits] r72392 - in /cfe/trunk/test/Sema: nonnull-check.c nonnull.c

Chris Lattner sabre at nondot.org
Mon May 25 11:20:12 PDT 2009


Author: lattner
Date: Mon May 25 13:20:11 2009
New Revision: 72392

URL: http://llvm.org/viewvc/llvm-project?rev=72392&view=rev
Log:
merge two tests.

Removed:
    cfe/trunk/test/Sema/nonnull-check.c
Modified:
    cfe/trunk/test/Sema/nonnull.c

Removed: cfe/trunk/test/Sema/nonnull-check.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/nonnull-check.c?rev=72391&view=auto

==============================================================================
--- cfe/trunk/test/Sema/nonnull-check.c (original)
+++ cfe/trunk/test/Sema/nonnull-check.c (removed)
@@ -1,26 +0,0 @@
-// RUN: clang-cc -fblocks -Wnonnull -fsyntax-only -verify %s
-
-extern void func1 (void (^block1)(), void (^block2)(), int) __attribute__((nonnull));
-
-extern void func3 (void (^block1)(), int, void (^block2)(), int)
-  __attribute__((nonnull(1,3)));
-
-extern void func4 (void (^block1)(), void (^block2)()) __attribute__((nonnull(1)))
-  __attribute__((nonnull(2)));
-
-void
-foo (int i1, int i2, int i3, void (^cp1)(), void (^cp2)(), void (^cp3)())
-{
-  func1(cp1, cp2, i1);
-
-  func1(0, cp2, i1);  // expected-warning {{null passed to a callee which requires a non-null argument}}
-  func1(cp1, 0, i1);  // expected-warning {{null passed to a callee which requires a non-null argument}}
-  func1(cp1, cp2, 0);
-
-
-  func3(0, i2, cp3, i3); // expected-warning {{null passed to a callee which requires a non-null argument}}
-  func3(cp3, i2, 0, i3);  // expected-warning {{null passed to a callee which requires a non-null argument}}
-
-  func4(0, cp1); // expected-warning {{null passed to a callee which requires a non-null argument}}
-  func4(cp1, 0); // expected-warning {{null passed to a callee which requires a non-null argument}}
-}

Modified: cfe/trunk/test/Sema/nonnull.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/nonnull.c?rev=72392&r1=72391&r2=72392&view=diff

==============================================================================
--- cfe/trunk/test/Sema/nonnull.c (original)
+++ cfe/trunk/test/Sema/nonnull.c Mon May 25 13:20:11 2009
@@ -1,4 +1,4 @@
-// RUN: clang-cc -fsyntax-only -verify %s
+// RUN: clang-cc -fblocks -fsyntax-only -verify %s
 
 int f1(int x) __attribute__((nonnull)); // expected-warning{{'nonnull' attribute applied to function with no pointer arguments}}
 int f2(int *x) __attribute__ ((nonnull (1)));
@@ -6,3 +6,27 @@
 int f4(int *x, int *y) __attribute__ ((nonnull (1,2)));
 int f5(int *x, int *y) __attribute__ ((nonnull (2,1)));
 
+extern void func1 (void (^block1)(), void (^block2)(), int) __attribute__((nonnull));
+
+extern void func3 (void (^block1)(), int, void (^block2)(), int)
+__attribute__((nonnull(1,3)));
+
+extern void func4 (void (^block1)(), void (^block2)()) __attribute__((nonnull(1)))
+__attribute__((nonnull(2)));
+
+void
+foo (int i1, int i2, int i3, void (^cp1)(), void (^cp2)(), void (^cp3)())
+{
+  func1(cp1, cp2, i1);
+  
+  func1(0, cp2, i1);  // expected-warning {{null passed to a callee which requires a non-null argument}}
+  func1(cp1, 0, i1);  // expected-warning {{null passed to a callee which requires a non-null argument}}
+  func1(cp1, cp2, 0);
+  
+  
+  func3(0, i2, cp3, i3); // expected-warning {{null passed to a callee which requires a non-null argument}}
+  func3(cp3, i2, 0, i3);  // expected-warning {{null passed to a callee which requires a non-null argument}}
+  
+  func4(0, cp1); // expected-warning {{null passed to a callee which requires a non-null argument}}
+  func4(cp1, 0); // expected-warning {{null passed to a callee which requires a non-null argument}}
+}





More information about the cfe-commits mailing list