File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,20 @@ INLINE int calledTransitively() {
1818 return 42 ;
1919}
2020
21+ #ifdef __cplusplus
22+ class C {
23+ public:
24+ int memberFunctionCalledTransitively () {
25+ return 42 ;
26+ }
27+ };
28+ #endif
29+
2130INLINE int calledFromSwift () {
31+ #ifdef __cplusplus
32+ C c;
33+ return calledTransitively () + c.memberFunctionCalledTransitively ();
34+ #else
2235 return calledTransitively ();
36+ #endif
2337}
Original file line number Diff line number Diff line change 1- module EmitCalledFunction {
2- header "emit-called-function.h"
1+ module EmitCalledInlineFunction {
2+ header "emit-called-inline- function.h"
33 export *
44}
Original file line number Diff line number Diff line change 88// RUN: %target-swift-frontend %s -I %S/Inputs -Xcc -std=c99 -emit-ir -o - | %FileCheck %s -check-prefix C99 --implicit-check-not notCalled
99// RUN: %target-swift-frontend %s -I %S/Inputs -enable-cxx-interop -emit-ir -o - | %FileCheck %s -check-prefix CXX --implicit-check-not notCalled
1010
11- import EmitCalledFunction
11+ import EmitCalledInlineFunction
1212
1313// C99-DAG: define internal i32 @calledFromSwift() #{{[0-9]+}} {
1414// C99-DAG: define internal i32 @calledTransitively() #{{[0-9]+}} {
1515
1616// CXX-DAG: define linkonce_odr i32 @_Z15calledFromSwiftv() #{{[0-9]+}} comdat {
1717// CXX-DAG: define linkonce_odr i32 @_Z18calledTransitivelyv() #{{[0-9]+}} comdat {
18+ // CXX-DAG: define linkonce_odr i32 @_ZN1C32memberFunctionCalledTransitivelyEv(%class.C* %this)
1819
1920calledFromSwift ( )
You can’t perform that action at this time.
0 commit comments