[cfe-commits] r93072 - in /cfe/trunk/test: Analysis/ Lexer/ Sema/ SemaObjC/
Chris Lattner
sabre at nondot.org
Sat Jan 9 12:43:19 PST 2010
Author: lattner
Date: Sat Jan 9 14:43:19 2010
New Revision: 93072
URL: http://llvm.org/viewvc/llvm-project?rev=93072&view=rev
Log:
add a bunch of missing prototypes to tests
Modified:
cfe/trunk/test/Analysis/CFDateGC.m
cfe/trunk/test/Analysis/PR2599.m
cfe/trunk/test/Analysis/casts.c
cfe/trunk/test/Analysis/dead-stores.c
cfe/trunk/test/Analysis/misc-ps-region-store.m
cfe/trunk/test/Analysis/misc-ps.m
cfe/trunk/test/Analysis/rdar-6442306-1.m
cfe/trunk/test/Analysis/retain-release-basic-store.m
cfe/trunk/test/Analysis/retain-release-region-store.m
cfe/trunk/test/Analysis/retain-release.m
cfe/trunk/test/Analysis/uninit-vals-ps-region.c
cfe/trunk/test/Lexer/numeric-literal-trash.c
cfe/trunk/test/Sema/attr-noreturn.c
cfe/trunk/test/Sema/block-labels.c
cfe/trunk/test/Sema/block-misc.c
cfe/trunk/test/Sema/block-return.c
cfe/trunk/test/Sema/conditional.c
cfe/trunk/test/Sema/format-strings.c
cfe/trunk/test/Sema/implicit-builtin-decl.c
cfe/trunk/test/Sema/implicit-decl.c
cfe/trunk/test/SemaObjC/bad-receiver-1.m
cfe/trunk/test/SemaObjC/ivar-access-package.m
cfe/trunk/test/SemaObjC/nonnull.m
cfe/trunk/test/SemaObjC/protocol-archane.m
Modified: cfe/trunk/test/Analysis/CFDateGC.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/CFDateGC.m?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/CFDateGC.m (original)
+++ cfe/trunk/test/Analysis/CFDateGC.m Sat Jan 9 14:43:19 2010
@@ -1,8 +1,8 @@
-// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify -fobjc-gc -analyzer-constraints=basic %s
-// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify -fobjc-gc -analyzer-constraints=range %s
-// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify -fobjc-gc -disable-free %s
-// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify -fobjc-gc %s
-// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -fobjc-gc %s
+// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify -fobjc-gc -analyzer-constraints=basic %s -Wno-implicit-function-declaration
+// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify -fobjc-gc -analyzer-constraints=range %s -Wno-implicit-function-declaration
+// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=basic -verify -fobjc-gc -disable-free %s -Wno-implicit-function-declaration
+// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=basic -verify -fobjc-gc %s -Wno-implicit-function-declaration
+// RUN: %clang_cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -analyzer-constraints=range -verify -fobjc-gc %s -Wno-implicit-function-declaration
//===----------------------------------------------------------------------===//
// The following code is reduced using delta-debugging from
@@ -36,6 +36,8 @@
// Test cases.
//===----------------------------------------------------------------------===//
+CFAbsoluteTime CFAbsoluteTimeGetCurrent();
+
CFAbsoluteTime f1_use_after_release() {
CFAbsoluteTime t = CFAbsoluteTimeGetCurrent();
CFDateRef date = CFDateCreate(0, t);
Modified: cfe/trunk/test/Analysis/PR2599.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/PR2599.m?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/PR2599.m (original)
+++ cfe/trunk/test/Analysis/PR2599.m Sat Jan 9 14:43:19 2010
@@ -53,6 +53,8 @@
static char *lorem = "fooBarBaz";
+void NSLog(NSString *, ...);
+
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString *tmp1 = NSSTRINGWRAPPER(lorem, 6); // no-warning
Modified: cfe/trunk/test/Analysis/casts.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/casts.c?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/casts.c (original)
+++ cfe/trunk/test/Analysis/casts.c Sat Jan 9 14:43:19 2010
@@ -11,6 +11,8 @@
struct sockaddr { sa_family_t sa_family; };
struct sockaddr_storage {};
+void getsockname();
+
void f(int sock) {
struct sockaddr_storage storage;
struct sockaddr* sockaddr = (struct sockaddr*)&storage;
Modified: cfe/trunk/test/Analysis/dead-stores.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/dead-stores.c?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/dead-stores.c (original)
+++ cfe/trunk/test/Analysis/dead-stores.c Sat Jan 9 14:43:19 2010
@@ -17,6 +17,8 @@
// expected-note{{please include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
}
+int f();
+
void f3() {
int r;
if ((r = f()) != 0) { // no-warning
Modified: cfe/trunk/test/Analysis/misc-ps-region-store.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps-region-store.m?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps-region-store.m (original)
+++ cfe/trunk/test/Analysis/misc-ps-region-store.m Sat Jan 9 14:43:19 2010
@@ -55,7 +55,7 @@
// Check our handling of fields being invalidated by function calls.
struct test2_struct { int x; int y; char* s; };
-void test2_helper(struct test2_struct* p);
+void test2_help(struct test2_struct* p);
char test2() {
struct test2_struct s;
@@ -387,7 +387,7 @@
char value[1];
if ( *(value) != 1 ) {} // expected-warning{{The left operand of '!=' is a garbage value}}
}
-void rdar_rdar_7332673_test2_aux(char *x);
+int rdar_7332673_test2_aux(char *x);
void rdar_7332673_test2() {
char *value;
if ( rdar_7332673_test2_aux(value) != 1 ) {} // expected-warning{{Pass-by-value argument in function call is undefined}}
@@ -631,7 +631,7 @@
//===----------------------------------------------------------------------===//
int rdar7468209_aux();
-void rdar7468209_aux2();
+void rdar7468209_aux_2();
void rdar7468209() {
__block int x = 0;
Modified: cfe/trunk/test/Analysis/misc-ps.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps.m?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps.m (original)
+++ cfe/trunk/test/Analysis/misc-ps.m Sat Jan 9 14:43:19 2010
@@ -460,6 +460,8 @@
(void (^)(void *))test_block_cast_aux(); // expected-warning{{expression result unused}}
}
+int OSAtomicCompareAndSwap32Barrier();
+
// Test comparison of 'id' instance variable to a null void* constant after
// performing an OSAtomicCompareAndSwap32Barrier.
// This previously was a crash in RegionStoreManager.
@@ -493,6 +495,8 @@
return;
}
+int ivar_getOffset();
+
// Reduced from a crash involving the cast of an Objective-C symbolic region to
// 'char *'
static NSNumber *test_ivar_offset(id self, SEL _cmd, Ivar inIvar) {
Modified: cfe/trunk/test/Analysis/rdar-6442306-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/rdar-6442306-1.m?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/rdar-6442306-1.m (original)
+++ cfe/trunk/test/Analysis/rdar-6442306-1.m Sat Jan 9 14:43:19 2010
@@ -13,6 +13,8 @@
QuxSize size;
} __Request__SetPortalSize_t;
+double __Foo_READSWAP__double(double*);
+
static __inline__ bar_return_t
__Beeble_check__Request__SetPortalSize_t(__attribute__((__unused__)) __Request__SetPortalSize_t *In0P) {
if (In0P->Foo.int_rep != Foo_record.int_rep) {
Modified: cfe/trunk/test/Analysis/retain-release-basic-store.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release-basic-store.m?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release-basic-store.m (original)
+++ cfe/trunk/test/Analysis/retain-release-basic-store.m Sat Jan 9 14:43:19 2010
@@ -86,6 +86,8 @@
NSDate* f;
};
+CFAbsoluteTime CFAbsoluteTimeGetCurrent(void);
+
CFAbsoluteTime f4() {
struct foo x;
Modified: cfe/trunk/test/Analysis/retain-release-region-store.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release-region-store.m?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release-region-store.m (original)
+++ cfe/trunk/test/Analysis/retain-release-region-store.m Sat Jan 9 14:43:19 2010
@@ -93,6 +93,8 @@
// Test to see if we *issue* an error when we store the pointer
// to a struct. This differs from basic store.
+CFAbsoluteTime CFAbsoluteTimeGetCurrent(void);
+
struct foo {
NSDate* f;
};
Modified: cfe/trunk/test/Analysis/retain-release.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/retain-release.m?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/retain-release.m (original)
+++ cfe/trunk/test/Analysis/retain-release.m Sat Jan 9 14:43:19 2010
@@ -881,6 +881,8 @@
// Test of handling objects whose references "escape" to containers.
//===----------------------------------------------------------------------===//
+void CFDictionaryAddValue();
+
// <rdar://problem/6539791>
void rdar_6539791(CFMutableDictionaryRef y, void* key, void* val_key) {
CFMutableDictionaryRef x = CFDictionaryCreateMutable(kCFAllocatorDefault, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
Modified: cfe/trunk/test/Analysis/uninit-vals-ps-region.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-vals-ps-region.c?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/uninit-vals-ps-region.c (original)
+++ cfe/trunk/test/Analysis/uninit-vals-ps-region.c Sat Jan 9 14:43:19 2010
@@ -20,6 +20,7 @@
// Test uninitialized value due to part of the structure being uninitialized.
struct TestUninit { int x; int y; };
struct TestUninit test_uninit_aux();
+void test_unit_aux2(int);
void test_uninit_pos() {
struct TestUninit v1 = { 0, 0 };
struct TestUninit v2 = test_uninit_aux();
Modified: cfe/trunk/test/Lexer/numeric-literal-trash.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/numeric-literal-trash.c?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/numeric-literal-trash.c (original)
+++ cfe/trunk/test/Lexer/numeric-literal-trash.c Sat Jan 9 14:43:19 2010
@@ -4,7 +4,7 @@
-
+int ec(int, int);
void x() {
Modified: cfe/trunk/test/Sema/attr-noreturn.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-noreturn.c?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-noreturn.c (original)
+++ cfe/trunk/test/Sema/attr-noreturn.c Sat Jan 9 14:43:19 2010
@@ -2,6 +2,8 @@
static void (*fp0)(void) __attribute__((noreturn));
+void fatal();
+
static void __attribute__((noreturn)) f0(void) {
fatal();
} // expected-warning {{function declared 'noreturn' should not return}}
Modified: cfe/trunk/test/Sema/block-labels.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-labels.c?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-labels.c (original)
+++ cfe/trunk/test/Sema/block-labels.c Sat Jan 9 14:43:19 2010
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 %s -verify -fblocks -fsyntax-only
+void xx();
+
int a() {
A:if (1) xx();
return ^{A:return 1;}();
Modified: cfe/trunk/test/Sema/block-misc.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-misc.c?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-misc.c (original)
+++ cfe/trunk/test/Sema/block-misc.c Sat Jan 9 14:43:19 2010
@@ -64,6 +64,7 @@
}
+void bar(void*);
// rdar://6257721 - reference to static/global is byref by default.
static int test5g;
void test5() {
@@ -157,6 +158,8 @@
__block int (*ap)[size]; // expected-error {{__block attribute not allowed on declaration with a variably modified type}}
}
+void f();
+
void test17() {
void (^bp)(int);
void (*rp)(int);
Modified: cfe/trunk/test/Sema/block-return.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-return.c?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-return.c (original)
+++ cfe/trunk/test/Sema/block-return.c Sat Jan 9 14:43:19 2010
@@ -76,6 +76,7 @@
else
return 0;
}
+void next();
void foo4() {
int (^xx)(const char *s) = ^(char *s) { return 1; }; // expected-error {{incompatible block pointer types initializing 'int (^)(char *)', expected 'int (^)(char const *)'}}
int (*yy)(const char *s) = funk; // expected-warning {{incompatible pointer types initializing 'int (char *)', expected 'int (*)(char const *)'}}
Modified: cfe/trunk/test/Sema/conditional.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/conditional.c?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Sema/conditional.c (original)
+++ cfe/trunk/test/Sema/conditional.c Sat Jan 9 14:43:19 2010
@@ -3,6 +3,7 @@
const char* test1 = 1 ? "i" : 1 == 1 ? "v" : "r";
void _efree(void *ptr);
+void free(void *ptr);
int _php_stream_free1() {
return (1 ? free(0) : _efree(0)); // expected-error {{incompatible type returning 'void', expected 'int'}}
Modified: cfe/trunk/test/Sema/format-strings.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/format-strings.c?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Sema/format-strings.c (original)
+++ cfe/trunk/test/Sema/format-strings.c Sat Jan 9 14:43:19 2010
@@ -8,6 +8,7 @@
int snprintf(char *restrict, size_t, const char *restrict, ...);
int sprintf(char *restrict, const char *restrict, ...);
int vasprintf(char **, const char *, va_list);
+int asprintf(char **, const char *, ...);
int vfprintf(FILE *, const char *restrict, va_list);
int vprintf(const char *restrict, va_list);
int vsnprintf(char *, size_t, const char *, va_list);
Modified: cfe/trunk/test/Sema/implicit-builtin-decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/implicit-builtin-decl.c?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Sema/implicit-builtin-decl.c (original)
+++ cfe/trunk/test/Sema/implicit-builtin-decl.c Sat Jan 9 14:43:19 2010
@@ -22,7 +22,8 @@
}
void f2() {
- fprintf(0, "foo"); // expected-error{{implicit declaration of 'fprintf' requires inclusion of the header <stdio.h>}}
+ fprintf(0, "foo"); // expected-error{{implicit declaration of 'fprintf' requires inclusion of the header <stdio.h>}} \
+ expected-warning {{implicit declaration of function 'fprintf' is invalid in C99}}
}
// PR2892
Modified: cfe/trunk/test/Sema/implicit-decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/implicit-decl.c?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/Sema/implicit-decl.c (original)
+++ cfe/trunk/test/Sema/implicit-decl.c Sat Jan 9 14:43:19 2010
@@ -7,7 +7,8 @@
int32_t *vector[16];
const char compDesc[16 + 1];
int32_t compCount = 0;
- if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // expected-note {{previous implicit declaration is here}}
+ if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // expected-note {{previous implicit declaration is here}} \
+ expected-warning {{implicit declaration of function '_CFCalendarDecomposeAbsoluteTimeV' is invalid in C99}}
}
return ((void *)0); // expected-warning {{void function 'func' should not return a value}}
}
Modified: cfe/trunk/test/SemaObjC/bad-receiver-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/bad-receiver-1.m?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/bad-receiver-1.m (original)
+++ cfe/trunk/test/SemaObjC/bad-receiver-1.m Sat Jan 9 14:43:19 2010
@@ -4,6 +4,8 @@
- (id) retain;
@end
+int objc_lookUpClass(const char*);
+
void __raiseExc1() {
[objc_lookUpClass("NSString") retain]; // expected-warning {{receiver type 'int' is not 'id'}} \
expected-warning {{method '-retain' not found}}
Modified: cfe/trunk/test/SemaObjC/ivar-access-package.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/ivar-access-package.m?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/ivar-access-package.m (original)
+++ cfe/trunk/test/SemaObjC/ivar-access-package.m Sat Jan 9 14:43:19 2010
@@ -34,6 +34,8 @@
}
@end
+void NSLog(id, ...);
+
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
A *a = [[A new] autorelease];
Modified: cfe/trunk/test/SemaObjC/nonnull.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/nonnull.m?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/nonnull.m (original)
+++ cfe/trunk/test/SemaObjC/nonnull.m Sat Jan 9 14:43:19 2010
@@ -19,6 +19,9 @@
extern void func4 (void (^block1)(), void (^block2)()) __attribute__((nonnull(1)))
__attribute__((nonnull(2)));
+void func6();
+void func7();
+
void
foo (int i1, int i2, int i3, void (^cp1)(), void (^cp2)(), void (^cp3)())
{
Modified: cfe/trunk/test/SemaObjC/protocol-archane.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/protocol-archane.m?rev=93072&r1=93071&r2=93072&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/protocol-archane.m (original)
+++ cfe/trunk/test/SemaObjC/protocol-archane.m Sat Jan 9 14:43:19 2010
@@ -5,6 +5,7 @@
- (void) bar;
@end
+void bar();
void foo(id x) {
bar((short<SomeProtocol>)x); // expected-error {{expected ')'}} expected-note {{to match this '('}}
bar((<SomeProtocol>)x); // expected-warning {{protocol qualifiers without 'id' is archaic}}
More information about the cfe-commits
mailing list