From 5759fa798bcc4291f54e51f960dcfc49972d7f00 Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Tue, 24 Oct 2017 23:12:01 +0000 Subject: Correct behavior of fastcall when default CC is set. Fastcall doesn't support variadic function calls, so setting the default calling convention to Fastcall would result in incorrect code being emitted for these conditions. This patch adds a 'variadic' test to the default calling conv test, as well as fixes the behavior of fastcall. llvm-svn: 316528 --- clang/test/CodeGenCXX/default_calling_conv.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/test/CodeGenCXX/default_calling_conv.cpp') diff --git a/clang/test/CodeGenCXX/default_calling_conv.cpp b/clang/test/CodeGenCXX/default_calling_conv.cpp index 95c214a223d..15eedc8e318 100644 --- a/clang/test/CodeGenCXX/default_calling_conv.cpp +++ b/clang/test/CodeGenCXX/default_calling_conv.cpp @@ -10,6 +10,13 @@ // VECTORCALL: define x86_vectorcallcc void @_Z5test1v void test1() {} +// fastcall, stdcall, and vectorcall all do not support variadic functions. +// CDECL: define void @_Z12testVariadicz +// FASTCALL: define void @_Z12testVariadicz +// STDCALL: define void @_Z12testVariadicz +// VECTORCALL: define void @_Z12testVariadicz +void testVariadic(...){} + // ALL: define void @_Z5test2v void __attribute__((cdecl)) test2() {} -- cgit v1.2.3