xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/mangle-windows.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
2f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-mingw32 | FileCheck %s
3*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-windows-msvc-elf | FileCheck %s --check-prefix=ELF32
4*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-win32 | FileCheck %s --check-prefix=X64
5*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-mingw32 | FileCheck %s --check-prefix=X64
6*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-pc-windows-msvc-elf | FileCheck %s --check-prefix=ELF64
7*0a6a1f1dSLionel Sambuc 
8*0a6a1f1dSLionel Sambuc // CHECK: target datalayout = "e-m:w-{{.*}}"
9*0a6a1f1dSLionel Sambuc // X64: target datalayout = "e-m:e-{{.*}}"
10*0a6a1f1dSLionel Sambuc // ELF32: target datalayout = "e-m:e-{{.*}}"
11*0a6a1f1dSLionel Sambuc // ELF64: target datalayout = "e-m:e-{{.*}}"
12f4a2713aSLionel Sambuc 
f1(void)13f4a2713aSLionel Sambuc void __stdcall f1(void) {}
14f4a2713aSLionel Sambuc // CHECK: define x86_stdcallcc void @"\01_f1@0"
15*0a6a1f1dSLionel Sambuc // X64: define void @f1(
16*0a6a1f1dSLionel Sambuc // ELF32: define x86_stdcallcc void @"\01_f1@0"
17*0a6a1f1dSLionel Sambuc // ELF64: define void @f1(
18f4a2713aSLionel Sambuc 
f2(void)19f4a2713aSLionel Sambuc void __fastcall f2(void) {}
20f4a2713aSLionel Sambuc // CHECK: define x86_fastcallcc void @"\01@f2@0"
21*0a6a1f1dSLionel Sambuc // X64: define void @f2(
22*0a6a1f1dSLionel Sambuc // ELF32: define x86_fastcallcc void @"\01@f2@0"
23*0a6a1f1dSLionel Sambuc // ELF64: define void @f2(
24f4a2713aSLionel Sambuc 
f3()25f4a2713aSLionel Sambuc void __stdcall f3() {}
26f4a2713aSLionel Sambuc // CHECK: define x86_stdcallcc void @"\01_f3@0"
27*0a6a1f1dSLionel Sambuc // X64: define void @f3(
28f4a2713aSLionel Sambuc 
f4(char a)29f4a2713aSLionel Sambuc void __fastcall f4(char a) {}
30f4a2713aSLionel Sambuc // CHECK: define x86_fastcallcc void @"\01@f4@4"
31*0a6a1f1dSLionel Sambuc // X64: define void @f4(
32f4a2713aSLionel Sambuc 
f5(short a)33f4a2713aSLionel Sambuc void __fastcall f5(short a) {}
34f4a2713aSLionel Sambuc // CHECK: define x86_fastcallcc void @"\01@f5@4"
35*0a6a1f1dSLionel Sambuc // X64: define void @f5(
36f4a2713aSLionel Sambuc 
f6(int a)37f4a2713aSLionel Sambuc void __fastcall f6(int a) {}
38f4a2713aSLionel Sambuc // CHECK: define x86_fastcallcc void @"\01@f6@4"
39*0a6a1f1dSLionel Sambuc // X64: define void @f6(
40f4a2713aSLionel Sambuc 
f7(long a)41f4a2713aSLionel Sambuc void __fastcall f7(long a) {}
42f4a2713aSLionel Sambuc // CHECK: define x86_fastcallcc void @"\01@f7@4"
43*0a6a1f1dSLionel Sambuc // X64: define void @f7(
44f4a2713aSLionel Sambuc 
f8(long long a)45f4a2713aSLionel Sambuc void __fastcall f8(long long a) {}
46f4a2713aSLionel Sambuc // CHECK: define x86_fastcallcc void @"\01@f8@8"
47*0a6a1f1dSLionel Sambuc // X64: define void @f8(
48f4a2713aSLionel Sambuc 
f9(long long a,char b,char c,short d)49f4a2713aSLionel Sambuc void __fastcall f9(long long a, char b, char c, short d) {}
50*0a6a1f1dSLionel Sambuc // CHECK: define x86_fastcallcc void @"\01@f9@20"(i64 %a, i8 signext %b, i8 signext %c, i16 signext %d)
51*0a6a1f1dSLionel Sambuc // X64: define void @f9(
52f4a2713aSLionel Sambuc 
f12(void)53f4a2713aSLionel Sambuc void f12(void) {}
54f4a2713aSLionel Sambuc // CHECK: define void @f12(
55*0a6a1f1dSLionel Sambuc // X64: define void @f12(
56*0a6a1f1dSLionel Sambuc 
v1(void)57*0a6a1f1dSLionel Sambuc void __vectorcall v1(void) {}
58*0a6a1f1dSLionel Sambuc // CHECK: define x86_vectorcallcc void @"\01v1@@0"(
59*0a6a1f1dSLionel Sambuc // X64: define x86_vectorcallcc void @"\01v1@@0"(
60*0a6a1f1dSLionel Sambuc // ELF32: define x86_vectorcallcc void @"\01v1@@0"(
61*0a6a1f1dSLionel Sambuc // ELF64: define x86_vectorcallcc void @"\01v1@@0"(
62*0a6a1f1dSLionel Sambuc 
v2(char a)63*0a6a1f1dSLionel Sambuc void __vectorcall v2(char a) {}
64*0a6a1f1dSLionel Sambuc // CHECK: define x86_vectorcallcc void @"\01v2@@4"(
65*0a6a1f1dSLionel Sambuc // X64: define x86_vectorcallcc void @"\01v2@@8"(
66*0a6a1f1dSLionel Sambuc // ELF32: define x86_vectorcallcc void @"\01v2@@4"(
67*0a6a1f1dSLionel Sambuc // ELF64: define x86_vectorcallcc void @"\01v2@@8"(
68*0a6a1f1dSLionel Sambuc 
v3(short a)69*0a6a1f1dSLionel Sambuc void __vectorcall v3(short a) {}
70*0a6a1f1dSLionel Sambuc // CHECK: define x86_vectorcallcc void @"\01v3@@4"(
71*0a6a1f1dSLionel Sambuc // X64: define x86_vectorcallcc void @"\01v3@@8"(
72*0a6a1f1dSLionel Sambuc 
v4(int a)73*0a6a1f1dSLionel Sambuc void __vectorcall v4(int a) {}
74*0a6a1f1dSLionel Sambuc // CHECK: define x86_vectorcallcc void @"\01v4@@4"(
75*0a6a1f1dSLionel Sambuc // X64: define x86_vectorcallcc void @"\01v4@@8"(
76*0a6a1f1dSLionel Sambuc 
v5(long long a)77*0a6a1f1dSLionel Sambuc void __vectorcall v5(long long a) {}
78*0a6a1f1dSLionel Sambuc // CHECK: define x86_vectorcallcc void @"\01v5@@8"(
79*0a6a1f1dSLionel Sambuc // X64: define x86_vectorcallcc void @"\01v5@@8"(
80*0a6a1f1dSLionel Sambuc 
v6(char a,char b)81*0a6a1f1dSLionel Sambuc void __vectorcall v6(char a, char b) {}
82*0a6a1f1dSLionel Sambuc // CHECK: define x86_vectorcallcc void @"\01v6@@8"(
83*0a6a1f1dSLionel Sambuc // X64: define x86_vectorcallcc void @"\01v6@@16"(
84