Debian Codegraph @

clang/test/CodeGen/calling-conv-ignored.c

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