1 // RUN: %clang_cc1 -no-opaque-pointers -triple i686-windows-msvc -emit-llvm -o - %s | FileCheck %s --check-prefix=X86 2 // RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-windows-msvc -emit-llvm -o - %s | FileCheck %s --check-prefix=X64 3 // RUN: %clang_cc1 -no-opaque-pointers -triple i686-windows-msvc -emit-llvm -o - %s -fdefault-calling-conv=vectorcall | FileCheck %s --check-prefix=X86-VEC 4 // RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-windows-msvc -emit-llvm -o - %s -fdefault-calling-conv=vectorcall | FileCheck %s --check-prefix=X64-VEC 5 6 void foo_default(const char *lpString1, const char *lpString2); 7 void __stdcall foo_std(const char *lpString1, const char *lpString2); 8 void __fastcall foo_fast(const char *lpString1, const char *lpString2); 9 void __vectorcall foo_vector(const char *lpString1, const char *lpString2); 10 11 void __cdecl bar(void) { 12 foo_default(0, 0); 13 foo_std(0, 0); 14 foo_fast(0, 0); 15 foo_vector(0, 0); 16 } 17 18 // X86-LABEL: define dso_local void @bar() 19 // X86: call void @foo_default(i8* noundef null, i8* noundef null) 20 // X86: call x86_stdcallcc void @"\01_foo_std@8"(i8* noundef null, i8* noundef null) 21 // X86: call x86_fastcallcc void @"\01@foo_fast@8"(i8* inreg noundef null, i8* inreg noundef null) 22 // X86: call x86_vectorcallcc void @"\01foo_vector@@8"(i8* inreg noundef null, i8* inreg noundef null) 23 // X86: ret void 24 25 // X64-LABEL: define dso_local void @bar() 26 // X64: call void @foo_default(i8* noundef null, i8* noundef null) 27 // X64: call void @foo_std(i8* noundef null, i8* noundef null) 28 // X64: call void @foo_fast(i8* noundef null, i8* noundef null) 29 // X64: call x86_vectorcallcc void @"\01foo_vector@@16"(i8* noundef null, i8* noundef null) 30 // X64: ret void 31 32 // X86-VEC-LABEL: define dso_local void @bar() 33 // X86-VEC: call x86_vectorcallcc void @"\01foo_default@@8"(i8* inreg noundef null, i8* inreg noundef null) 34 // X86-VEC: call x86_stdcallcc void @"\01_foo_std@8"(i8* noundef null, i8* noundef null) 35 // X86-VEC: call x86_fastcallcc void @"\01@foo_fast@8"(i8* inreg noundef null, i8* inreg noundef null) 36 // X86-VEC: call x86_vectorcallcc void @"\01foo_vector@@8"(i8* inreg noundef null, i8* inreg noundef null) 37 // X86-VEC: ret void 38 39 // X64-VEC-LABEL: define dso_local void @bar() 40 // X64-VEC: call x86_vectorcallcc void @"\01foo_default@@16"(i8* noundef null, i8* noundef null) 41 // X64-VEC: call void @foo_std(i8* noundef null, i8* noundef null) 42 // X64-VEC: call void @foo_fast(i8* noundef null, i8* noundef null) 43 // X64-VEC: call x86_vectorcallcc void @"\01foo_vector@@16"(i8* noundef null, i8* noundef null) 44 // X64-VEC: ret void 45 46