Prep for new warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76709 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/arg-scope-c99.c b/test/Sema/arg-scope-c99.c
index b5b1c8a..1d81410 100644
--- a/test/Sema/arg-scope-c99.c
+++ b/test/Sema/arg-scope-c99.c
@@ -1,2 +1,2 @@
// RUN: clang-cc -fsyntax-only -std=c99 -verify %s
-int bb(int sz, int ar[sz][sz]) { }
+void bb(int sz, int ar[sz][sz]) { }
diff --git a/test/Sema/arg-scope.c b/test/Sema/arg-scope.c
index c1cc7e1..d5e5960 100644
--- a/test/Sema/arg-scope.c
+++ b/test/Sema/arg-scope.c
@@ -1,5 +1,5 @@
// RUN: clang-cc -fsyntax-only -verify %s
-int aa(int b, int x[sizeof b]) {}
+void aa(int b, int x[sizeof b]) {}
void foo(int i, int A[i]) {}
diff --git a/test/Sema/array-constraint.c b/test/Sema/array-constraint.c
index 5a09e20..6407b5d 100644
--- a/test/Sema/array-constraint.c
+++ b/test/Sema/array-constraint.c
@@ -45,7 +45,7 @@
void strFunc(char *);
const char staticAry[] = "test";
-int checkStaticAry() {
+void checkStaticAry() {
strFunc(staticAry); // expected-warning{{passing 'char const [5]' discards qualifiers, expected 'char *'}}
}
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c
index 50148a8..b7542b3 100644
--- a/test/Sema/array-init.c
+++ b/test/Sema/array-init.c
@@ -219,10 +219,10 @@
}
// PR2151
-int emptyInit() {struct {} x[] = {6};} //expected-warning{{empty struct extension}} expected-error{{initializer for aggregate with no elements}}
+void emptyInit() {struct {} x[] = {6};} //expected-warning{{empty struct extension}} expected-error{{initializer for aggregate with no elements}}
-int noNamedInit() {
-struct {int:5;} x[] = {6}; //expected-error{{initializer for aggregate with no elements}}
+void noNamedInit() {
+ struct {int:5;} x[] = {6}; //expected-error{{initializer for aggregate with no elements}}
}
struct {int a; int:5;} noNamedImplicit[] = {1,2,3};
int noNamedImplicitCheck[sizeof(noNamedImplicit) == 3 * sizeof(*noNamedImplicit) ? 1 : -1];
diff --git a/test/Sema/attr-weak.c b/test/Sema/attr-weak.c
index 4e28867..4532ccc 100644
--- a/test/Sema/attr-weak.c
+++ b/test/Sema/attr-weak.c
@@ -5,7 +5,7 @@
int g2 __attribute__((weak));
int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
int __attribute__((weak_import)) g4(void);
-int __attribute__((weak_import)) g5(void) {
+void __attribute__((weak_import)) g5(void) {
}
struct __attribute__((weak)) s0 {}; // expected-warning {{'weak' attribute only applies to variable and function types}}
diff --git a/test/Sema/block-misc.c b/test/Sema/block-misc.c
index 1f1cad4..a9a7df6 100644
--- a/test/Sema/block-misc.c
+++ b/test/Sema/block-misc.c
@@ -44,7 +44,7 @@
int^ x; // expected-error {{block pointer to non-function type is invalid}}
int^^ x1; // expected-error {{block pointer to non-function type is invalid}} expected-error {{block pointer to non-function type is invalid}}
-int test3() {
+void test3() {
char *^ y; // expected-error {{block pointer to non-function type is invalid}}
}
diff --git a/test/Sema/builtin-prefetch.c b/test/Sema/builtin-prefetch.c
index 6b39e75..bf28277 100644
--- a/test/Sema/builtin-prefetch.c
+++ b/test/Sema/builtin-prefetch.c
@@ -1,6 +1,6 @@
// RUN: clang-cc -fsyntax-only -verify %s
-int foo() {
+void foo() {
int a;
__builtin_prefetch(&a);
__builtin_prefetch(&a, 1);
diff --git a/test/Sema/builtins.c b/test/Sema/builtins.c
index 78b7562..068f300 100644
--- a/test/Sema/builtins.c
+++ b/test/Sema/builtins.c
@@ -34,7 +34,7 @@
// atomics.
-unsigned char test9(short v) {
+void test9(short v) {
unsigned i, old;
old = __sync_fetch_and_add(); // expected-error {{too few arguments to function call}}
diff --git a/test/Sema/c89.c b/test/Sema/c89.c
index e7585c3..9bf720b 100644
--- a/test/Sema/c89.c
+++ b/test/Sema/c89.c
@@ -36,7 +36,7 @@
/* Implicit int, always ok */
-test6() {}
+test6() { return 0; }
/* PR2012 */
test7; /* expected-warning {{declaration specifier missing, defaulting to 'int'}} */
diff --git a/test/Sema/darwin-align-cast.c b/test/Sema/darwin-align-cast.c
index 09808b5..313a9e3 100644
--- a/test/Sema/darwin-align-cast.c
+++ b/test/Sema/darwin-align-cast.c
@@ -19,5 +19,6 @@
union {
char control[(((__darwin_size_t)((char *)(sizeof(struct cmsghdr)) + (sizeof(__darwin_size_t) - 1)) &~ (sizeof(__darwin_size_t) - 1)) + ((__darwin_size_t)((char *)(sizeof(int)) + (sizeof(__darwin_size_t) - 1)) &~ (sizeof(__darwin_size_t) - 1)))];
} control_un;
+ return 0;
}
diff --git a/test/Sema/decl-type-merging.c b/test/Sema/decl-type-merging.c
index 1b789a1..1a86012 100644
--- a/test/Sema/decl-type-merging.c
+++ b/test/Sema/decl-type-merging.c
@@ -6,11 +6,11 @@
int (*a)(int (*x)[10], int (*y)[]);
int (*a)(int (*x)[], int (*y)[5]);
-int b() {
-int x[10], y[5];
-a(&x, &y);
-a(&y, &y); // expected-warning {{incompatible pointer}}
-a(&x, &x); // expected-warning {{incompatible pointer}}
+void b() {
+ int x[10], y[5];
+ a(&x, &y);
+ a(&y, &y); // expected-warning {{incompatible pointer}}
+ a(&x, &x); // expected-warning {{incompatible pointer}}
}
diff --git a/test/Sema/heinous-extensions-on.c b/test/Sema/heinous-extensions-on.c
index 480b1b4..a56f1f6 100644
--- a/test/Sema/heinous-extensions-on.c
+++ b/test/Sema/heinous-extensions-on.c
@@ -1,10 +1,9 @@
// RUN: clang-cc %s -verify -fheinous-gnu-extensions
-int foo() {
- int a;
- // PR3788
- asm("nop" : : "m"((int)(a))); // expected-warning {{cast in a inline asm context requiring an l-value}}
- // PR3794
- asm("nop" : "=r"((unsigned)a)); // expected-warning {{cast in a inline asm context requiring an l-value}}
+void foo() {
+ int a;
+ // PR3788
+ asm("nop" : : "m"((int)(a))); // expected-warning {{cast in a inline asm context requiring an l-value}}
+ // PR3794
+ asm("nop" : "=r"((unsigned)a)); // expected-warning {{cast in a inline asm context requiring an l-value}}
}
-
diff --git a/test/Sema/implicit-int.c b/test/Sema/implicit-int.c
index 04b27a8..9eab953 100644
--- a/test/Sema/implicit-int.c
+++ b/test/Sema/implicit-int.c
@@ -1,6 +1,7 @@
// RUN: clang-cc -fsyntax-only %s -verify -pedantic
foo() { // expected-warning {{type specifier missing, defaults to 'int'}}
+ return 0;
}
y; // expected-warning {{type specifier missing, defaults to 'int'}}
diff --git a/test/Sema/redefinition.c b/test/Sema/redefinition.c
index 26c90c8..9339bb9 100644
--- a/test/Sema/redefinition.c
+++ b/test/Sema/redefinition.c
@@ -1,7 +1,7 @@
// RUN: clang-cc %s -fsyntax-only -verify
-int f(int a) { } // expected-note {{previous definition is here}}
+int f(int a) { return 0; } // expected-note {{previous definition is here}}
int f(int);
-int f(int a) { } // expected-error {{redefinition of 'f'}}
+int f(int a) { return 0; } // expected-error {{redefinition of 'f'}}
// <rdar://problem/6097326>
int foo(x) {
diff --git a/test/Sema/type-spec-struct-union.c b/test/Sema/type-spec-struct-union.c
index 2b68b78..003efb1 100644
--- a/test/Sema/type-spec-struct-union.c
+++ b/test/Sema/type-spec-struct-union.c
@@ -57,7 +57,7 @@
} mode;
int nowrap;
};
-int
+void
wizbiz_quxPoof(z)
z_foop z;
{
diff --git a/test/Sema/va_arg_x86_64.c b/test/Sema/va_arg_x86_64.c
index 680abb7..61ac97b 100644
--- a/test/Sema/va_arg_x86_64.c
+++ b/test/Sema/va_arg_x86_64.c
@@ -8,9 +8,8 @@
// PR2692
typedef __builtin_va_list va_list;
-static char *f (char * (*g) (char **, int), char **p, ...) {
- char *s;
- va_list v;
- s = g (p, __builtin_va_arg(v, int));
+static void f (char * (*g) (char **, int), char **p, ...) {
+ char *s;
+ va_list v;
+ s = g (p, __builtin_va_arg(v, int));
}
-