@@ -31,7 +31,7 @@ class test_class {
31
31
int a;
32
32
public:
33
33
#ifndef WIN_TEST
34
- __regcall
34
+ __regcall
35
35
#endif
36
36
test_class (){++x;}
37
37
// CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_classC1Ev
@@ -41,15 +41,15 @@ class test_class {
41
41
// CHECK-WIN32-DAG: define linkonce_odr dso_local x86_thiscallcc %class.test_class* @"??0test_class@@QAE@XZ"
42
42
43
43
#ifndef WIN_TEST
44
- __regcall
44
+ __regcall
45
45
#endif
46
46
~test_class (){--x;}
47
47
// CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_classD2Ev
48
48
// CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_classD1Ev
49
49
// Windows ignores calling convention on constructor/destructors.
50
50
// CHECK-WIN64-DAG: define linkonce_odr dso_local void @"??1test_class@@QEAA@XZ"
51
51
// CHECK-WIN32-DAG: define linkonce_odr dso_local x86_thiscallcc void @"??1test_class@@QAE@XZ"
52
-
52
+
53
53
test_class& __regcall operator +=(const test_class&){
54
54
return *this ;
55
55
}
@@ -60,7 +60,7 @@ class test_class {
60
60
// CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_class20__regcall3__do_thingEv
61
61
// CHECK-WIN64-DAG: define linkonce_odr dso_local x86_regcallcc void @"?do_thing@test_class@@QEAwXXZ"
62
62
// CHECK-WIN32-DAG: define linkonce_odr dso_local x86_regcallcc void @"?do_thing@test_class@@QAwXXZ"
63
-
63
+
64
64
template <typename T>
65
65
void __regcall tempFunc (T i){}
66
66
// CHECK-LIN-DAG: define linkonce_odr x86_regcallcc void @_ZN10test_class20__regcall3__tempFuncIiEEvT_
@@ -103,3 +103,18 @@ long double _Complex __regcall foo(long double _Complex f) {
103
103
// CHECK-LIN32-DAG: define x86_regcallcc void @_Z15__regcall3__fooCe({ x86_fp80, x86_fp80 }* inreg noalias sret align 4 %agg.result, { x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 4 %f)
104
104
// CHECK-WIN64-DAG: define dso_local x86_regcallcc { double, double } @"?foo@@YwU?$_Complex@O@__clang@@U12@@Z"(double %f.0, double %f.1)
105
105
// CHECK-WIN32-DAG: define dso_local x86_regcallcc { double, double } @"?foo@@YwU?$_Complex@O@__clang@@U12@@Z"(double %f.0, double %f.1)
106
+
107
+ // The following caused us to dereference uninitialized memory. The long name
108
+ // seems necessary, as does the return types.
109
+ float _Complex __regcall callee (float _Complex f);
110
+ // CHECK-LIN64-DAG: declare x86_regcallcc <2 x float> @_Z18__regcall3__calleeCf(<2 x float>)
111
+ // CHECK-LIN32-DAG: declare x86_regcallcc { float, float } @_Z18__regcall3__calleeCf(float, float)
112
+ // CHECK-WIN64-DAG: declare dso_local x86_regcallcc { float, float } @"?callee@@YwU?$_Complex@M@__clang@@U12@@Z"(float, float)
113
+ // CHECK-WIN32-DAG: declare dso_local x86_regcallcc { float, float } @"?callee@@YwU?$_Complex@M@__clang@@U12@@Z"(float, float)
114
+
115
+ __regcall int
116
+ some_really_long_name_that_manages_to_hit_the_right_spot_of_mem (int a) {
117
+ float _Complex x[2 ];
118
+ x[0 ] = callee (x[0 ]);
119
+ return a;
120
+ }
0 commit comments