]> granicus.if.org Git - clang/commitdiff
merge two tests.
authorChris Lattner <sabre@nondot.org>
Mon, 25 May 2009 18:20:11 +0000 (18:20 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 25 May 2009 18:20:11 +0000 (18:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72392 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/nonnull-check.c [deleted file]
test/Sema/nonnull.c

diff --git a/test/Sema/nonnull-check.c b/test/Sema/nonnull-check.c
deleted file mode 100644 (file)
index 8454c7c..0000000
+++ /dev/null
@@ -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}}
-}
index 3d9b329abe65f08ed70eac5a91da7f0b064596b8..3bed2feb5012b908b8aabf5460df3585dcff4828 100644 (file)
@@ -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 f3(int *x) __attribute__ ((nonnull (0))); // expected-error {{'nonnull' attr
 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}}
+}