1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -fms-extensions -Wno-microsoft -triple=i386-pc-win32 -emit-llvm %s -o - | FileCheck %s 2*f4a2713aSLionel Sambuc 3*f4a2713aSLionel Sambuc __interface I { 4*f4a2713aSLionel Sambuc int test() { 5*f4a2713aSLionel Sambuc return 1; 6*f4a2713aSLionel Sambuc } 7*f4a2713aSLionel Sambuc }; 8*f4a2713aSLionel Sambuc 9*f4a2713aSLionel Sambuc struct S : I { 10*f4a2713aSLionel Sambuc virtual int test() override { 11*f4a2713aSLionel Sambuc return I::test(); 12*f4a2713aSLionel Sambuc } 13*f4a2713aSLionel Sambuc }; 14*f4a2713aSLionel Sambuc 15*f4a2713aSLionel Sambuc int fn() { 16*f4a2713aSLionel Sambuc S s; 17*f4a2713aSLionel Sambuc return s.test(); 18*f4a2713aSLionel Sambuc } 19*f4a2713aSLionel Sambuc 20*f4a2713aSLionel Sambuc // 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*f4a2713aSLionel Sambuc 22*f4a2713aSLionel Sambuc // CHECK-LABEL: define i32 @_Z2fnv() 23*f4a2713aSLionel Sambuc // CHECK: call void @_ZN1SC1Ev(%struct.S* %s) 24*f4a2713aSLionel Sambuc // CHECK: %{{[.0-9A-Z_a-z]+}} = call i32 @_ZN1S4testEv(%struct.S* %s) 25*f4a2713aSLionel Sambuc 26*f4a2713aSLionel Sambuc // CHECK-LABEL: define linkonce_odr void @_ZN1SC1Ev(%struct.S* %this) 27*f4a2713aSLionel Sambuc // CHECK: call void @_ZN1SC2Ev(%struct.S* %{{[.0-9A-Z_a-z]+}}) 28*f4a2713aSLionel Sambuc 29*f4a2713aSLionel Sambuc // CHECK-LABEL: define linkonce_odr i32 @_ZN1S4testEv(%struct.S* %this) 30*f4a2713aSLionel Sambuc // CHECK: %{{[.0-9A-Z_a-z]+}} = call i32 @_ZN1I4testEv(%__interface.I* %{{[.0-9A-Z_a-z]+}}) 31*f4a2713aSLionel Sambuc 32*f4a2713aSLionel Sambuc // CHECK-LABEL: define linkonce_odr i32 @_ZN1I4testEv(%__interface.I* %this) 33*f4a2713aSLionel Sambuc // CHECK: ret i32 1 34*f4a2713aSLionel Sambuc 35*f4a2713aSLionel Sambuc // CHECK-LABEL: define linkonce_odr void @_ZN1SC2Ev(%struct.S* %this) 36*f4a2713aSLionel Sambuc // CHECK: call void @_ZN1IC2Ev(%__interface.I* %{{[.0-9A-Z_a-z]+}}) 37*f4a2713aSLionel Sambuc // CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1S, i64 0, i64 2), i8*** %{{[.0-9A-Z_a-z]+}} 38*f4a2713aSLionel Sambuc 39*f4a2713aSLionel Sambuc // CHECK-LABEL: define linkonce_odr void @_ZN1IC2Ev(%__interface.I* %this) 40*f4a2713aSLionel Sambuc // CHECK: store i8** getelementptr inbounds ([3 x i8*]* @_ZTV1I, i64 0, i64 2), i8*** %{{[.0-9A-Z_a-z]+}} 41*f4a2713aSLionel Sambuc 42*f4a2713aSLionel Sambuc // CHECK-NOT-LABEL: define linkonce_odr %__interface.I* @_ZN1IaSERKS_(%__interface.I* %this, %__interface.I*) 43*f4a2713aSLionel Sambuc // CHECK-NOT-LABEL: define linkonce_odr %__interface.I* @_ZN1IaSEOS_(%__interface.I* %this, %__interface.I*) 44