File: calling-conv-ignored.c

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (45 lines) | stat: -rw-r--r-- 2,619 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// RUN: %clang_cc1 -no-opaque-pointers -triple i686-windows-msvc   -emit-llvm -o - %s | FileCheck %s --check-prefix=X86
// RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-windows-msvc -emit-llvm -o - %s | FileCheck %s --check-prefix=X64
// RUN: %clang_cc1 -no-opaque-pointers -triple i686-windows-msvc   -emit-llvm -o - %s -fdefault-calling-conv=vectorcall | FileCheck %s --check-prefix=X86-VEC
// 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

void foo_default(const char *lpString1, const char *lpString2);
void __stdcall foo_std(const char *lpString1, const char *lpString2);
void __fastcall foo_fast(const char *lpString1, const char *lpString2);
void __vectorcall foo_vector(const char *lpString1, const char *lpString2);

void __cdecl bar(void) {
  foo_default(0, 0);
  foo_std(0, 0);
  foo_fast(0, 0);
  foo_vector(0, 0);
}

// X86-LABEL: define dso_local void @bar()
// X86:   call void @foo_default(i8* noundef null, i8* noundef null)
// X86:   call x86_stdcallcc void @"\01_foo_std@8"(i8* noundef null, i8* noundef null)
// X86:   call x86_fastcallcc void @"\01@foo_fast@8"(i8* inreg noundef null, i8* inreg noundef null)
// X86:   call x86_vectorcallcc void @"\01foo_vector@@8"(i8* inreg noundef null, i8* inreg noundef null)
// X86:   ret void

// X64-LABEL: define dso_local void @bar()
// X64:   call void @foo_default(i8* noundef null, i8* noundef null)
// X64:   call void @foo_std(i8* noundef null, i8* noundef null)
// X64:   call void @foo_fast(i8* noundef null, i8* noundef null)
// X64:   call x86_vectorcallcc void @"\01foo_vector@@16"(i8* noundef null, i8* noundef null)
// X64:   ret void

// X86-VEC-LABEL: define dso_local void @bar()
// X86-VEC:   call x86_vectorcallcc void @"\01foo_default@@8"(i8* inreg noundef null, i8* inreg noundef null)
// X86-VEC:   call x86_stdcallcc void @"\01_foo_std@8"(i8* noundef null, i8* noundef null)
// X86-VEC:   call x86_fastcallcc void @"\01@foo_fast@8"(i8* inreg noundef null, i8* inreg noundef null)
// X86-VEC:   call x86_vectorcallcc void @"\01foo_vector@@8"(i8* inreg noundef null, i8* inreg noundef null)
// X86-VEC:   ret void

// X64-VEC-LABEL: define dso_local void @bar()
// X64-VEC:   call x86_vectorcallcc void @"\01foo_default@@16"(i8* noundef null, i8* noundef null)
// X64-VEC:   call void @foo_std(i8* noundef null, i8* noundef null)
// X64-VEC:   call void @foo_fast(i8* noundef null, i8* noundef null)
// X64-VEC:   call x86_vectorcallcc void @"\01foo_vector@@16"(i8* noundef null, i8* noundef null)
// X64-VEC:   ret void