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() {
18
18
return 42 ;
19
19
}
20
20
21
+ #ifdef __cplusplus
22
+ class C {
23
+ public:
24
+ int memberFunctionCalledTransitively () {
25
+ return 42 ;
26
+ }
27
+ };
28
+ #endif
29
+
21
30
INLINE int calledFromSwift () {
31
+ #ifdef __cplusplus
32
+ C c;
33
+ return calledTransitively () + c.memberFunctionCalledTransitively ();
34
+ #else
22
35
return calledTransitively ();
36
+ #endif
23
37
}
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"
3
3
export *
4
4
}
Original file line number Diff line number Diff line change 8
8
// RUN: %target-swift-frontend %s -I %S/Inputs -Xcc -std=c99 -emit-ir -o - | %FileCheck %s -check-prefix C99 --implicit-check-not notCalled
9
9
// RUN: %target-swift-frontend %s -I %S/Inputs -enable-cxx-interop -emit-ir -o - | %FileCheck %s -check-prefix CXX --implicit-check-not notCalled
10
10
11
- import EmitCalledFunction
11
+ import EmitCalledInlineFunction
12
12
13
13
// C99-DAG: define internal i32 @calledFromSwift() #{{[0-9]+}} {
14
14
// C99-DAG: define internal i32 @calledTransitively() #{{[0-9]+}} {
15
15
16
16
// CXX-DAG: define linkonce_odr i32 @_Z15calledFromSwiftv() #{{[0-9]+}} comdat {
17
17
// CXX-DAG: define linkonce_odr i32 @_Z18calledTransitivelyv() #{{[0-9]+}} comdat {
18
+ // CXX-DAG: define linkonce_odr i32 @_ZN1C32memberFunctionCalledTransitivelyEv(%class.C* %this)
18
19
19
20
calledFromSwift ( )
You can’t perform that action at this time.
0 commit comments