summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-02-17 19:31:09 +0000
committerChris Lattner <sabre@nondot.org>2008-02-17 19:31:09 +0000
commitb080ed504e0f617a9532cc37f6c4a853bd5b7996 (patch)
treedc7da794d1c550abf539e43ddae78dc79477686a /clang/test
parentffd09922478f4bbda0d952ef9f5dd79dee145a44 (diff)
downloadbcm5719-llvm-b080ed504e0f617a9532cc37f6c4a853bd5b7996.tar.gz
bcm5719-llvm-b080ed504e0f617a9532cc37f6c4a853bd5b7996.zip
Fix PR2042. One remaining issue: we don't currently diagnose
int foobar(int); int foobar() {} which requires ifdef'ing out a testcase in predefined-function.c. llvm-svn: 47236
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Parser/implicit-casts.c2
-rw-r--r--clang/test/Sema/function.c4
-rw-r--r--clang/test/Sema/predefined-function.c4
3 files changed, 8 insertions, 2 deletions
diff --git a/clang/test/Parser/implicit-casts.c b/clang/test/Parser/implicit-casts.c
index 1636f4993e4..2e8e0001822 100644
--- a/clang/test/Parser/implicit-casts.c
+++ b/clang/test/Parser/implicit-casts.c
@@ -14,7 +14,7 @@ void test2() {
}
int test3() {
int a[2];
- a[0] = test3; // expected-warning{{incompatible pointer to integer conversion assigning 'int (void)', expected 'int'}}
+ a[0] = test3; // expected-warning{{incompatible pointer to integer conversion assigning 'int ()', expected 'int'}}
}
short x; void test4(char c) { x += c; }
int y; void test5(char c) { y += c; }
diff --git a/clang/test/Sema/function.c b/clang/test/Sema/function.c
index 8ef453581fc..2a18dbb7050 100644
--- a/clang/test/Sema/function.c
+++ b/clang/test/Sema/function.c
@@ -25,3 +25,7 @@ int t8(, int a); // expected-error {{expected parameter declarator}}
int t9(int a, ); // expected-error {{expected parameter declarator}}
+// PR2042
+void t10(){}
+void t11(){t10(1);}
+
diff --git a/clang/test/Sema/predefined-function.c b/clang/test/Sema/predefined-function.c
index 1dcd1d38a28..daade82b465 100644
--- a/clang/test/Sema/predefined-function.c
+++ b/clang/test/Sema/predefined-function.c
@@ -20,16 +20,18 @@ int bar(int i) // expected-error {{previous definition is here}}
{
return 0;
}
-int bar() // expected-error {{redefinition of 'bar'}} expected-error {{conflicting types for 'bar'}}
+int bar() // expected-error {{redefinition of 'bar'}}
{
return 0;
}
+#if 0
int foobar(int); // expected-error {{previous declaration is here}}
int foobar() // expected-error {{conflicting types for 'foobar'}}
{
return 0;
}
+#endif
int wibble(); // expected-error {{previous declaration is here}}
float wibble() // expected-error {{conflicting types for 'wibble'}}
OpenPOWER on IntegriCloud