2014-03-28 06:50:18 +08:00
|
|
|
// RUN: %clang_cc1 -std=c++11 -fms-extensions -Wno-microsoft -triple=i386-pc-windows-gnu -emit-llvm %s -o - | FileCheck %s
|
2012-09-25 15:32:39 +08:00
|
|
|
|
|
|
|
__interface I {
|
|
|
|
int test() {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S : I {
|
|
|
|
virtual int test() override {
|
|
|
|
return I::test();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
int fn() {
|
|
|
|
S s;
|
|
|
|
return s.test();
|
|
|
|
}
|
|
|
|
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK: @_ZTV1S = linkonce_odr dso_local unnamed_addr constant { [3 x i8*] } { [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1S to i8*), i8* bitcast (i32 (%struct.S*)* @_ZN1S4testEv to i8*)] }
|
2012-09-25 15:32:39 +08:00
|
|
|
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK-LABEL: define dso_local i32 @_Z2fnv()
|
2018-10-15 23:43:00 +08:00
|
|
|
// CHECK: call x86_thiscallcc void @_ZN1SC1Ev(%struct.S* %s)
|
2013-12-14 06:43:52 +08:00
|
|
|
// CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc i32 @_ZN1S4testEv(%struct.S* %s)
|
2012-09-25 15:32:39 +08:00
|
|
|
|
2018-10-15 23:43:00 +08:00
|
|
|
// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @_ZN1SC1Ev(%struct.S* %this)
|
|
|
|
// CHECK: call x86_thiscallcc void @_ZN1SC2Ev(%struct.S* %{{[.0-9A-Z_a-z]+}})
|
2012-09-25 15:32:39 +08:00
|
|
|
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc i32 @_ZN1S4testEv(%struct.S* %this)
|
2013-12-14 06:43:52 +08:00
|
|
|
// CHECK: %{{[.0-9A-Z_a-z]+}} = call x86_thiscallcc i32 @_ZN1I4testEv(%__interface.I* %{{[.0-9A-Z_a-z]+}})
|
2012-09-25 15:32:39 +08:00
|
|
|
|
2018-10-15 23:43:00 +08:00
|
|
|
// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @_ZN1SC2Ev(%struct.S* %this)
|
|
|
|
// CHECK: call x86_thiscallcc void @_ZN1IC2Ev(%__interface.I* %{{[.0-9A-Z_a-z]+}})
|
2016-12-14 04:50:44 +08:00
|
|
|
// CHECK: store i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTV1S, i32 0, inrange i32 0, i32 2) to i32 (...)**), i32 (...)*** %{{[.0-9A-Z_a-z]+}}
|
2012-09-25 15:32:39 +08:00
|
|
|
|
2018-10-15 23:43:00 +08:00
|
|
|
// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc void @_ZN1IC2Ev(%__interface.I* %this)
|
2016-12-14 04:50:44 +08:00
|
|
|
// CHECK: store i32 (...)** bitcast (i8** getelementptr inbounds ({ [3 x i8*] }, { [3 x i8*] }* @_ZTV1I, i32 0, inrange i32 0, i32 2) to i32 (...)**), i32 (...)*** %{{[.0-9A-Z_a-z]+}}
|
2015-01-22 08:24:57 +08:00
|
|
|
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK-LABEL: define linkonce_odr dso_local x86_thiscallcc i32 @_ZN1I4testEv(%__interface.I* %this)
|
2015-01-22 08:24:57 +08:00
|
|
|
// CHECK: ret i32 1
|