diff options
author | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
commit | 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df (patch) | |
tree | a9243275843fbeaa590afc07ee888e006b8d54ea /test/Sema/knr-def-call.c | |
parent | 69b4eca4a4255ba43baa5c1d9bbdec3ec17f479e (diff) | |
download | FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.zip FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.tar.gz |
Vendor import of clang trunk r126079:
http://llvm.org/svn/llvm-project/cfe/trunk@126079
Diffstat (limited to 'test/Sema/knr-def-call.c')
-rw-r--r-- | test/Sema/knr-def-call.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/Sema/knr-def-call.c b/test/Sema/knr-def-call.c index 66f2ec0..d054a04 100644 --- a/test/Sema/knr-def-call.c +++ b/test/Sema/knr-def-call.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -Wconversion -Wliteral-conversion -fsyntax-only -verify %s // C DR #316, PR 3626. void f0(a, b, c, d) int a,b,c,d; {} @@ -23,7 +23,19 @@ void f4() { } char *rindex(s, c) - register char *s, c; // expected-warning{{promoted type 'char *' of K&R function parameter is not compatible with the parameter type 'char const *' declared in a previous prototype}} + register char *s, c; // expected-warning{{promoted type 'char *' of K&R function parameter is not compatible with the parameter type 'const char *' declared in a previous prototype}} { return 0; } + +// PR8314 +void proto(int); +void proto(x) + int x; +{ +} + +void use_proto() { + proto(42.0); // expected-warning{{implicit conversion turns literal floating-point number into integer}} + (&proto)(42.0); // expected-warning{{implicit conversion turns literal floating-point number into integer}} +} |