Skip to content

Commit e9ca0c7

Browse files
committed
Responses to review comments by @gribozavr.
1 parent 6a57220 commit e9ca0c7

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

test/Interop/C/function/Inputs/emit-called-function.h renamed to test/Interop/C/function/Inputs/emit-called-inline-function.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
2130
INLINE int calledFromSwift() {
31+
#ifdef __cplusplus
32+
C c;
33+
return calledTransitively() + c.memberFunctionCalledTransitively();
34+
#else
2235
return calledTransitively();
36+
#endif
2337
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module EmitCalledFunction {
2-
header "emit-called-function.h"
1+
module EmitCalledInlineFunction {
2+
header "emit-called-inline-function.h"
33
export *
44
}

test/Interop/C/function/emit-called-inline-function-irgen.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
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

1920
calledFromSwift()

0 commit comments

Comments
 (0)