blob: 0b44bab7385458ba05f56f6b9c322fa8d2e4b449 [file] [log] [blame]
John McCalle402e722012-09-25 07:32:39 +00001// RUN: %clang_cc1 -std=c++11 -fms-extensions -Wno-microsoft -triple=i386-pc-win32 -emit-llvm %s -o - | FileCheck %s
2
3__interface I {
4 int test() {
5 return 1;
6 }
7};
8
9struct S : I {
10 virtual int test() override {
11 return I::test();
12 }
13};
14
15int fn() {
16 S s;
17 return s.test();
18}
19
20// CHECK: @_ZTV1S = linkonce_odr unnamed_addr constant [3 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1S to i8*), i8* bitcast (i32 (%struct.S*)* @_ZN1S4testEv to i8*)]
21
22// CHECK: define i32 @_Z2fnv()
23// CHECK: call void @_ZN1SC1Ev(%struct.S* %s)
NAKAMURA Takumi0e33dcd2012-09-25 09:53:18 +000024// CHECK: %{{[.0-9A-Z_a-z]+}} = call i32 @_ZN1S4testEv(%struct.S* %s)
John McCalle402e722012-09-25 07:32:39 +000025
26// CHECK: define linkonce_odr void @_ZN1SC1Ev(%struct.S* %this)
NAKAMURA Takumi0e33dcd2012-09-25 09:53:18 +000027// CHECK: call void @_ZN1SC2Ev(%struct.S* %{{[.0-9A-Z_a-z]+}})
John McCalle402e722012-09-25 07:32:39 +000028
29// CHECK: define linkonce_odr i32 @_ZN1S4testEv(%struct.S* %this)
NAKAMURA Takumi0e33dcd2012-09-25 09:53:18 +000030// CHECK: %{{[.0-9A-Z_a-z]+}} = call i32 @_ZN1I4testEv(%__interface.I* %{{[.0-9A-Z_a-z]+}})
John McCalle402e722012-09-25 07:32:39 +000031
32// CHECK: define linkonce_odr i32 @_ZN1I4testEv(%__interface.I* %this)
33// CHECK: ret i32 1
34
35// CHECK: define linkonce_odr void @_ZN1SC2Ev(%struct.S* %this)
NAKAMURA Takumi0e33dcd2012-09-25 09:53:18 +000036// CHECK: call void @_ZN1IC2Ev(%__interface.I* %{{[.0-9A-Z_a-z]+}})
37// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1S, i64 0, i64 2), i8*** %{{[.0-9A-Z_a-z]+}}
John McCalle402e722012-09-25 07:32:39 +000038
39// CHECK: define linkonce_odr void @_ZN1IC2Ev(%__interface.I* %this)
NAKAMURA Takumi0e33dcd2012-09-25 09:53:18 +000040// CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1I, i64 0, i64 2), i8*** %{{[.0-9A-Z_a-z]+}}
John McCalle402e722012-09-25 07:32:39 +000041
42// CHECK-NOT: define linkonce_odr %__interface.I* @_ZN1IaSERKS_(%__interface.I* %this, %__interface.I*)
43// CHECK-NOT: define linkonce_odr %__interface.I* @_ZN1IaSEOS_(%__interface.I* %this, %__interface.I*)