diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGen/microsoft-call-conv.c | 13 | ||||
-rw-r--r-- | clang/test/CodeGen/mrtd.c | 2 | ||||
-rw-r--r-- | clang/test/CodeGenCXX/mangle-ms.cpp | 2 | ||||
-rw-r--r-- | clang/test/Sema/callingconv.c | 2 | ||||
-rw-r--r-- | clang/test/Sema/decl-microsoft-call-conv.c | 11 | ||||
-rw-r--r-- | clang/test/Sema/stdcall-fastcall.c | 2 | ||||
-rw-r--r-- | clang/test/SemaCXX/decl-microsoft-call-conv.cpp | 13 |
7 files changed, 35 insertions, 10 deletions
diff --git a/clang/test/CodeGen/microsoft-call-conv.c b/clang/test/CodeGen/microsoft-call-conv.c index b80c58dfd1f..aabe825516a 100644 --- a/clang/test/CodeGen/microsoft-call-conv.c +++ b/clang/test/CodeGen/microsoft-call-conv.c @@ -20,6 +20,12 @@ void __thiscall f6(void) { f3(); // CHECK: call x86_thiscallcc void @f3() } +// FIXME: Add this to LLVM. +void __vectorcall f61(void) { +// CHECK-LABEL: define void @f61() + f3(); +// CHECK: call x86_thiscallcc void @f3() +} // PR5280 void (__fastcall *pf1)(void) = f1; @@ -28,19 +34,22 @@ void (__thiscall *pf3)(void) = f3; void (__fastcall *pf4)(void) = f4; void (__stdcall *pf5)(void) = f5; void (__thiscall *pf6)(void) = f6; +void (__vectorcall *pf7)(void) = f61; int main(void) { - f4(); f5(); f6(); + f4(); f5(); f6(); f61(); // CHECK: call x86_fastcallcc void @f4() // CHECK: call x86_stdcallcc void @f5() // CHECK: call x86_thiscallcc void @f6() - pf1(); pf2(); pf3(); pf4(); pf5(); pf6(); + // CHECK: call void @f61() + pf1(); pf2(); pf3(); pf4(); pf5(); pf6(); pf7(); // CHECK: call x86_fastcallcc void %{{.*}}() // CHECK: call x86_stdcallcc void %{{.*}}() // CHECK: call x86_thiscallcc void %{{.*}}() // CHECK: call x86_fastcallcc void %{{.*}}() // CHECK: call x86_stdcallcc void %{{.*}}() // CHECK: call x86_thiscallcc void %{{.*}}() + // CHECK: call void %{{.*}}() return 0; } diff --git a/clang/test/CodeGen/mrtd.c b/clang/test/CodeGen/mrtd.c index 1132d046095..f929d4c26b2 100644 --- a/clang/test/CodeGen/mrtd.c +++ b/clang/test/CodeGen/mrtd.c @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -mrtd -triple i386-unknown-unknown -std=c89 -emit-llvm -o - %s 2>&1 | FileCheck %s -// CHECK: mrtd.c:10:3: warning: function with no prototype cannot use the callee-cleanup stdcall calling convention +// CHECK: mrtd.c:10:3: warning: function with no prototype cannot use the stdcall calling convention void baz(int arg); diff --git a/clang/test/CodeGenCXX/mangle-ms.cpp b/clang/test/CodeGenCXX/mangle-ms.cpp index 3285c98546e..bf61d8b127b 100644 --- a/clang/test/CodeGenCXX/mangle-ms.cpp +++ b/clang/test/CodeGenCXX/mangle-ms.cpp @@ -365,3 +365,5 @@ void TypedefNewDelete::operator delete[](void *) { } // CHECK-DAG: ??3TypedefNewDelete@@SAXPAX@Z // CHECK-DAG: ??_VTypedefNewDelete@@SAXPAX@Z +void __vectorcall vector_func() { } +// CHECK-DAG: @"\01?vector_func@@YQXXZ" diff --git a/clang/test/Sema/callingconv.c b/clang/test/Sema/callingconv.c index 68908152ff6..5ac5a4ad044 100644 --- a/clang/test/Sema/callingconv.c +++ b/clang/test/Sema/callingconv.c @@ -10,7 +10,7 @@ void __attribute__((stdcall)) bar(float *a) { void __attribute__((fastcall(1))) baz(float *a) { // expected-error {{'fastcall' attribute takes no arguments}} } -void __attribute__((fastcall)) test0() { // expected-error {{function with no prototype cannot use the callee-cleanup fastcall calling convention}} +void __attribute__((fastcall)) test0() { // expected-error {{function with no prototype cannot use the fastcall calling convention}} } void __attribute__((fastcall)) test1(void) { diff --git a/clang/test/Sema/decl-microsoft-call-conv.c b/clang/test/Sema/decl-microsoft-call-conv.c index fefa8626eb6..c8fb6e10f9b 100644 --- a/clang/test/Sema/decl-microsoft-call-conv.c +++ b/clang/test/Sema/decl-microsoft-call-conv.c @@ -11,11 +11,14 @@ void __thiscall CrcGenerateTableThiscall(void); void __thiscall CrcGenerateTableThiscall() {} void __pascal CrcGenerateTablePascal(void); void __pascal CrcGenerateTablePascal() {} +void __vectorcall CrcGenerateTableVectorcall(void); +void __vectorcall CrcGenerateTableVectorcall() {} -void __fastcall CrcGenerateTableNoProtoFastcall() {} // expected-error{{function with no prototype cannot use the callee-cleanup fastcall calling convention}} -void __stdcall CrcGenerateTableNoProtoStdcall() {} // expected-warning{{function with no prototype cannot use the callee-cleanup stdcall calling convention}} -void __thiscall CrcGenerateTableNoProtoThiscall() {} // expected-error{{function with no prototype cannot use the callee-cleanup thiscall calling convention}} -void __pascal CrcGenerateTableNoProtoPascal() {} // expected-error{{function with no prototype cannot use the callee-cleanup pascal calling convention}} +void __fastcall CrcGenerateTableNoProtoFastcall() {} // expected-error{{function with no prototype cannot use the fastcall calling convention}} +void __stdcall CrcGenerateTableNoProtoStdcall() {} // expected-warning{{function with no prototype cannot use the stdcall calling convention}} +void __thiscall CrcGenerateTableNoProtoThiscall() {} // expected-error{{function with no prototype cannot use the thiscall calling convention}} +void __pascal CrcGenerateTableNoProtoPascal() {} // expected-error{{function with no prototype cannot use the pascal calling convention}} +void __vectorcall CrcGenerateTableNoProtoVectorcall() {} // expected-error{{function with no prototype cannot use the vectorcall calling convention}} // Regular calling convention is fine. void CrcGenerateTableNoProto() {} diff --git a/clang/test/Sema/stdcall-fastcall.c b/clang/test/Sema/stdcall-fastcall.c index e19b1102b26..256f5588e6d 100644 --- a/clang/test/Sema/stdcall-fastcall.c +++ b/clang/test/Sema/stdcall-fastcall.c @@ -6,7 +6,7 @@ int __attribute__((fastcall)) var2; // expected-warning{{'fastcall' only applies // Different CC qualifiers are not compatible void __attribute__((stdcall, fastcall)) foo3(void); // expected-error{{fastcall and stdcall attributes are not compatible}} -void __attribute__((stdcall)) foo4(); // expected-note{{previous declaration is here}} expected-warning{{function with no prototype cannot use the callee-cleanup stdcall calling convention}} +void __attribute__((stdcall)) foo4(); // expected-note{{previous declaration is here}} expected-warning{{function with no prototype cannot use the stdcall calling convention}} void __attribute__((fastcall)) foo4(void); // expected-error{{function declared 'fastcall' here was previously declared 'stdcall'}} // rdar://8876096 diff --git a/clang/test/SemaCXX/decl-microsoft-call-conv.cpp b/clang/test/SemaCXX/decl-microsoft-call-conv.cpp index eb6c8507edd..a4b68cdbc7d 100644 --- a/clang/test/SemaCXX/decl-microsoft-call-conv.cpp +++ b/clang/test/SemaCXX/decl-microsoft-call-conv.cpp @@ -10,6 +10,7 @@ void free_func_default(); // expected-note 2 {{previous declaration i void __cdecl free_func_cdecl(); // expected-note 2 {{previous declaration is here}} void __stdcall free_func_stdcall(); // expected-note 2 {{previous declaration is here}} void __fastcall free_func_fastcall(); // expected-note 2 {{previous declaration is here}} +void __vectorcall free_func_vectorcall(); // expected-note 2 {{previous declaration is here}} void __cdecl free_func_default(); void __stdcall free_func_default(); // expected-error {{function declared 'stdcall' here was previously declared without calling convention}} @@ -27,6 +28,10 @@ void __cdecl free_func_fastcall(); // expected-error {{function declared 'cde void __stdcall free_func_fastcall(); // expected-error {{function declared 'stdcall' here was previously declared 'fastcall'}} void free_func_fastcall(); +void __cdecl free_func_vectorcall(); // expected-error {{function declared 'cdecl' here was previously declared 'vectorcall'}} +void __stdcall free_func_vectorcall(); // expected-error {{function declared 'stdcall' here was previously declared 'vectorcall'}} +void free_func_vectorcall(); + // Overloaded functions may have different calling conventions void __fastcall free_func_default(int); void __cdecl free_func_default(int *); @@ -45,6 +50,8 @@ struct S { void __cdecl member_cdecl2(); // expected-note {{previous declaration is here}} void __thiscall member_thiscall1(); void __thiscall member_thiscall2(); // expected-note {{previous declaration is here}} + void __vectorcall member_vectorcall1(); + void __vectorcall member_vectorcall2(); // expected-note {{previous declaration is here}} // Typedefs carrying the __cdecl convention are adjusted to __thiscall. void_fun_t member_typedef_default; // expected-note {{previous declaration is here}} @@ -83,6 +90,9 @@ void __thiscall S::member_cdecl2() {} // expected-error {{function declared 'thi void S::member_thiscall1() {} void __cdecl S::member_thiscall2() {} // expected-error {{function declared 'cdecl' here was previously declared 'thiscall'}} +void S::member_vectorcall1() {} +void __cdecl S::member_vectorcall2() {} // expected-error {{function declared 'cdecl' here was previously declared 'vectorcall'}} + void S::static_member_default1() {} void __cdecl S::static_member_default2() {} void __stdcall S::static_member_default3() {} // expected-error {{function declared 'stdcall' here was previously declared without calling convention}} @@ -143,9 +153,10 @@ void __attribute__((noreturn)) __stdcall __attribute__((regparm(1))) multi_attri void multi_attribute(int x) { __builtin_unreachable(); } +// expected-error@+3 {{vectorcall and cdecl attributes are not compatible}} // expected-error@+2 {{stdcall and cdecl attributes are not compatible}} // expected-error@+1 {{fastcall and cdecl attributes are not compatible}} -void __cdecl __cdecl __stdcall __cdecl __fastcall multi_cc(int x); +void __cdecl __cdecl __stdcall __cdecl __fastcall __vectorcall multi_cc(int x); template <typename T> void __stdcall StdcallTemplate(T) {} template <> void StdcallTemplate<int>(int) {} |