aboutsummaryrefslogtreecommitdiff
path: root/test/Sema
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-09 20:43:19 +0000
committerChris Lattner <sabre@nondot.org>2010-01-09 20:43:19 +0000
commite030358cc06e1cbce3c2e00ca67c946f9164b2a8 (patch)
tree8a51ca98fa0b359fefb724103d5ca6d40c479c36 /test/Sema
parent7960ec30d794da5de6cd017c728e1151f7b101b9 (diff)
add a bunch of missing prototypes to tests
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93072 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema')
-rw-r--r--test/Sema/attr-noreturn.c2
-rw-r--r--test/Sema/block-labels.c2
-rw-r--r--test/Sema/block-misc.c3
-rw-r--r--test/Sema/block-return.c1
-rw-r--r--test/Sema/conditional.c1
-rw-r--r--test/Sema/format-strings.c1
-rw-r--r--test/Sema/implicit-builtin-decl.c3
-rw-r--r--test/Sema/implicit-decl.c3
8 files changed, 14 insertions, 2 deletions
diff --git a/test/Sema/attr-noreturn.c b/test/Sema/attr-noreturn.c
index 0966989bf9..3f064a01c8 100644
--- a/test/Sema/attr-noreturn.c
+++ b/test/Sema/attr-noreturn.c
@@ -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}}
diff --git a/test/Sema/block-labels.c b/test/Sema/block-labels.c
index af364b4f86..353a5702ea 100644
--- a/test/Sema/block-labels.c
+++ b/test/Sema/block-labels.c
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 %s -verify -fblocks -fsyntax-only
+void xx();
+
int a() {
A:if (1) xx();
return ^{A:return 1;}();
diff --git a/test/Sema/block-misc.c b/test/Sema/block-misc.c
index c1a2f08ff7..52cebfe892 100644
--- a/test/Sema/block-misc.c
+++ b/test/Sema/block-misc.c
@@ -64,6 +64,7 @@ int test4(int argc) { // rdar://6251437
}
+void bar(void*);
// rdar://6257721 - reference to static/global is byref by default.
static int test5g;
void test5() {
@@ -157,6 +158,8 @@ void test16(__block int i) { // expected-error {{__block attribute not allowed,
__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);
diff --git a/test/Sema/block-return.c b/test/Sema/block-return.c
index 4240b09856..6416545cb7 100644
--- a/test/Sema/block-return.c
+++ b/test/Sema/block-return.c
@@ -76,6 +76,7 @@ static int funk(char *s) {
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 *)'}}
diff --git a/test/Sema/conditional.c b/test/Sema/conditional.c
index e67580ace6..c3dbe1321b 100644
--- a/test/Sema/conditional.c
+++ b/test/Sema/conditional.c
@@ -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'}}
diff --git a/test/Sema/format-strings.c b/test/Sema/format-strings.c
index 67081b5e26..20e4dcd97f 100644
--- a/test/Sema/format-strings.c
+++ b/test/Sema/format-strings.c
@@ -8,6 +8,7 @@ int printf(const char *restrict, ...);
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);
diff --git a/test/Sema/implicit-builtin-decl.c b/test/Sema/implicit-builtin-decl.c
index 09ecd23ca1..3d920389a2 100644
--- a/test/Sema/implicit-builtin-decl.c
+++ b/test/Sema/implicit-builtin-decl.c
@@ -22,7 +22,8 @@ void h() {
}
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
diff --git a/test/Sema/implicit-decl.c b/test/Sema/implicit-decl.c
index fc48895f4e..830cde9b9f 100644
--- a/test/Sema/implicit-decl.c
+++ b/test/Sema/implicit-decl.c
@@ -7,7 +7,8 @@ void func() {
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}}
}