diff options
Diffstat (limited to 'test/Sema/knr-def-call.c')
| -rw-r--r-- | test/Sema/knr-def-call.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/test/Sema/knr-def-call.c b/test/Sema/knr-def-call.c index 80ad0d820b1a..2bd4a79fd0f8 100644 --- a/test/Sema/knr-def-call.c +++ b/test/Sema/knr-def-call.c @@ -1,13 +1,13 @@ -// RUN: %clang_cc1 -Wconversion -Wliteral-conversion -fsyntax-only -verify %s +// RUN: %clang_cc1 -triple i386-pc-unknown -Wconversion -Wliteral-conversion -fsyntax-only -verify %s // C DR #316, PR 3626. void f0(a, b, c, d) int a,b,c,d; {} -void t0(void) { +void t0(void) { f0(1); // expected-warning{{too few arguments}} } void f1(a, b) int a, b; {} -void t1(void) { +void t1(void) { f1(1, 2, 3); // expected-warning{{too many arguments}} } @@ -30,7 +30,7 @@ char *rindex(s, c) // PR8314 void proto(int); -void proto(x) +void proto(x) int x; { } @@ -39,3 +39,9 @@ void use_proto() { proto(42.1); // expected-warning{{implicit conversion from 'double' to 'int' changes value from 42.1 to 42}} (&proto)(42.1); // expected-warning{{implicit conversion from 'double' to 'int' changes value from 42.1 to 42}} } + +// PR31020 +void func(short d) __attribute__((cdecl)); // expected-note{{previous declaration is here}} +void __attribute__((cdecl)) func(d) + short d; // expected-warning{{promoted type 'int' of K&R function parameter is not compatible with the parameter type 'short' declared in a previous prototype}} +{} |
