summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/default_calling_conv.cpp
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2017-11-02 21:08:00 +0000
committerErich Keane <erich.keane@intel.com>2017-11-02 21:08:00 +0000
commit05b45eab313143ee8429824208c42f30e24bb013 (patch)
tree0fece87273a9257224d74716feaaac91e28924e3 /test/CodeGenCXX/default_calling_conv.cpp
parent603490dae39300a191e0485ce192a46176267397 (diff)
Add default calling convention support for regcall.
Added support for regcall as default calling convention. Also added code to exclude main when applying default calling conventions. Patch-By: eandrews Differential Revision: https://reviews.llvm.org/D39210 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317268 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/default_calling_conv.cpp')
-rw-r--r--test/CodeGenCXX/default_calling_conv.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/CodeGenCXX/default_calling_conv.cpp b/test/CodeGenCXX/default_calling_conv.cpp
index 15eedc8e31..b5b0f47ceb 100644
--- a/test/CodeGenCXX/default_calling_conv.cpp
+++ b/test/CodeGenCXX/default_calling_conv.cpp
@@ -3,18 +3,21 @@
// RUN: %clang_cc1 -triple i486-unknown-linux-gnu -fdefault-calling-conv=stdcall -emit-llvm -o - %s | FileCheck %s --check-prefix=STDCALL --check-prefix=ALL
// RUN: %clang_cc1 -triple i486-unknown-linux-gnu -mrtd -emit-llvm -o - %s | FileCheck %s --check-prefix=STDCALL --check-prefix=ALL
// RUN: %clang_cc1 -triple i986-unknown-linux-gnu -fdefault-calling-conv=vectorcall -emit-llvm -o - %s | FileCheck %s --check-prefix=VECTORCALL --check-prefix=ALL
+// RUN: %clang_cc1 -triple i986-unknown-linux-gnu -fdefault-calling-conv=regcall -emit-llvm -o - %s | FileCheck %s --check-prefix=REGCALL --check-prefix=ALL
// CDECL: define void @_Z5test1v
// FASTCALL: define x86_fastcallcc void @_Z5test1v
// STDCALL: define x86_stdcallcc void @_Z5test1v
// VECTORCALL: define x86_vectorcallcc void @_Z5test1v
+// REGCALL: define x86_regcallcc void @_Z17__regcall3__test1v
void test1() {}
-// fastcall, stdcall, and vectorcall all do not support variadic functions.
+// fastcall, stdcall, vectorcall and regcall do not support variadic functions.
// CDECL: define void @_Z12testVariadicz
// FASTCALL: define void @_Z12testVariadicz
// STDCALL: define void @_Z12testVariadicz
// VECTORCALL: define void @_Z12testVariadicz
+// REGCALL: define void @_Z12testVariadicz
void testVariadic(...){}
// ALL: define void @_Z5test2v
@@ -29,6 +32,9 @@ void __attribute__((stdcall)) test4() {}
// ALL: define x86_vectorcallcc void @_Z5test5v
void __attribute__((vectorcall)) test5() {}
+// ALL: define x86_regcallcc void @_Z17__regcall3__test6v
+void __attribute__((regcall)) test6() {}
+
// ALL: define linkonce_odr void @_ZN1A11test_memberEv
class A {
public:
@@ -39,3 +45,8 @@ void test() {
A a;
a.test_member();
}
+
+// ALL: define i32 @main
+int main() {
+ return 1;
+}