mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This addresses SR-15272. When you have a function (e.g. 'foo') which is used in a constructor initializer (e.g. constructor of some class 'Bar'), and you use the constructor from swift code without directly using the function (e.g. Bar's ctor is used from swift but foo isn't, foo is used from Bar's ctor), you will get a link error. My fix is as follows: When walking the clangAST to be imported, make sure you look at each CXXCtorInitializer for each CXXConstructorDecl you see.
11 lines
570 B
Swift
11 lines
570 B
Swift
// RUN: %target-swift-emit-ir %s -I %S/Inputs -enable-cxx-interop | %FileCheck %s
|
|
|
|
import ConstructorCallsFunctionFromNestedCalls
|
|
|
|
let a = Hold42WithLongInitCallGraph()
|
|
|
|
// CHECK-DAG: define linkonce_odr{{( dso_local)?}} i32 @{{_Z11get42Level1v|"\?get42Level1@@YAHXZ"}}
|
|
// CHECK-DAG: define linkonce_odr{{( dso_local)?}} i32 @{{_Z11get42Level2v|"\?get42Level2@@YAHXZ"}}
|
|
// CHECK-DAG: define linkonce_odr{{( dso_local)?}} i32 @{{_Z11get42Level3v|"\?get42Level3@@YAHXZ"}}
|
|
// CHECK-DAG: define linkonce_odr{{( dso_local)?}} i32 @{{_Z11get42Level4v|"\?get42Level4@@YAHXZ"}}
|