1 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
5 void simple_method() {}
7 void __cdecl
cdecl_method() {}
9 void vararg_method(const char *fmt
, ...) {}
11 static void static_method() {}
16 void call_simple_method() {
19 instance
.simple_method();
20 // Make sure that the call uses the right calling convention:
21 // CHECK: call x86_thiscallcc void @"?simple_method@C@@QAEXXZ"
24 // Make sure that the definition uses the right calling convention:
25 // CHECK: define linkonce_odr dso_local x86_thiscallcc void @"?simple_method@C@@QAEXXZ"
29 void call_cdecl_method() {
31 instance
.cdecl_method();
32 // Make sure that the call uses the right calling convention:
33 // CHECK: call void @"?cdecl_method@C@@QAAXXZ"
36 // Make sure that the definition uses the right calling convention:
37 // CHECK: define linkonce_odr dso_local void @"?cdecl_method@C@@QAAXXZ"
41 void call_vararg_method() {
43 instance
.vararg_method("Hello");
44 // Make sure that the call uses the right calling convention:
45 // CHECK: call void (ptr, ptr, ...) @"?vararg_method@C@@QAAXPBDZZ"
48 // Make sure that the definition uses the right calling convention:
49 // CHECK: define linkonce_odr dso_local void @"?vararg_method@C@@QAAXPBDZZ"
52 void call_static_method() {
54 // Make sure that the call uses the right calling convention:
55 // CHECK: call void @"?static_method@C@@SAXXZ"
58 // Make sure that the definition uses the right calling convention:
59 // CHECK: define linkonce_odr dso_local void @"?static_method@C@@SAXXZ"
68 class Child
: public Base
{ };
72 // Make sure that the Base constructor call noundef in the Child constructor uses
73 // the right calling convention:
74 // CHECK: define linkonce_odr dso_local x86_thiscallcc noundef ptr @"??0Child@@QAE@XZ"
75 // CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc noundef ptr @"??0Base@@QAE@XZ"
78 // Make sure that the Base destructor call noundef in the Child denstructor uses
79 // the right calling convention:
80 // CHECK: define linkonce_odr dso_local x86_thiscallcc void @"??1Child@@QAE@XZ"
81 // CHECK: call x86_thiscallcc void @"??1Base@@QAE@XZ"
84 // Make sure that the Base constructor definition uses the right CC:
85 // CHECK: define linkonce_odr dso_local x86_thiscallcc noundef ptr @"??0Base@@QAE@XZ"
87 // Make sure that the Base destructor definition uses the right CC:
88 // CHECK: define linkonce_odr dso_local x86_thiscallcc void @"??1Base@@QAE@XZ"