summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/callingconv.c
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2013-10-08 21:52:56 +0000
committerHans Wennborg <hans@hanshq.net>2013-10-08 21:52:56 +0000
commit9112ac2136894c6903f3e0df9639592ef78a3b50 (patch)
tree1c056335b6c91b783c49a6819724c581c4cac17f /clang/test/Sema/callingconv.c
parent347c2aa3e3b29440a0f3ae389ca9f2dbe9a99c6a (diff)
downloadbcm5719-llvm-9112ac2136894c6903f3e0df9639592ef78a3b50.tar.gz
bcm5719-llvm-9112ac2136894c6903f3e0df9639592ef78a3b50.zip
Turn error about fastcall variadic function into warning in MS mode (PR12535)
MSVC allows this and silently falls back to __cdecl for variadic functions. This patch turns Clang's error into a warning in MS mode and adds a test to make sure we generate correct code. Differential Revision: http://llvm-reviews.chandlerc.com/D1861 llvm-svn: 192240
Diffstat (limited to 'clang/test/Sema/callingconv.c')
-rw-r--r--clang/test/Sema/callingconv.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Sema/callingconv.c b/clang/test/Sema/callingconv.c
index 5badc14a01f..732c6add6ea 100644
--- a/clang/test/Sema/callingconv.c
+++ b/clang/test/Sema/callingconv.c
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 %s -fsyntax-only -triple i386-unknown-unknown -verify
+// RUN: %clang_cc1 %s -fsyntax-only -triple i386-unknown-unknown -fms-compatibility -DWIN -verify
void __attribute__((fastcall)) foo(float *a) {
}
@@ -15,8 +16,13 @@ void __attribute__((fastcall)) test0() { // expected-error {{function with no pr
void __attribute__((fastcall)) test1(void) {
}
+#ifdef WIN
+void __attribute__((fastcall)) test2(int a, ...) { // expected-warning {{fastcall calling convention ignored on variadic function}}
+}
+#else
void __attribute__((fastcall)) test2(int a, ...) { // expected-error {{variadic function cannot use fastcall calling convention}}
}
+#endif
void __attribute__((cdecl)) ctest0() {}
OpenPOWER on IntegriCloud