mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Restructure the COFF metadata handling to use the linker section grouping to emit section start/stop markers in the appropriate location. This allows us to lookup the sections statically without having to the walk the entire image structure. Introduce a constructor for PE/COFF binaries. This will ensure that the registration occurs for all modules appropriately. This should resolve rdar://problem/19045112. The registration should occur prior to `DllMain` being invoked from `DllMainCRTStartup`.
36 lines
1.0 KiB
Swift
36 lines
1.0 KiB
Swift
// RUN: %swift -target thumbv7--windows-itanium -parse-stdlib -parse-as-library -module-name Swift -O -emit-ir %s -o - | %FileCheck %s
|
|
|
|
// REQUIRES: CODEGENERATOR=ARM
|
|
|
|
precedencegroup AssignmentPrecedence {
|
|
assignment: true
|
|
}
|
|
|
|
public enum Optional<Wrapped> {
|
|
case none
|
|
case some(Wrapped)
|
|
}
|
|
|
|
public protocol P {
|
|
associatedtype T
|
|
}
|
|
|
|
public struct S : P {
|
|
public typealias T = Optional<S>
|
|
}
|
|
|
|
var gg = S()
|
|
|
|
public func f(s : S) -> (() -> ()) {
|
|
return { gg = s }
|
|
}
|
|
|
|
// CHECK-DAG: @"\01l__swift3_reflection_descriptor" = private constant {{.*}}, section ".sw3cptr$B"
|
|
// CHECK-DAG: @{{[0-9]+}} = private constant [3 x i8] c"Sq\00", section ".sw3tyrf$B"
|
|
// CHECK-DAG: @{{[0-9]+}} = private constant [5 x i8] c"none\00", section ".sw3rfst$B"
|
|
// CHECK-DAG: @{{[0-9]+}} = private constant [5 x i8] c"some\00", section ".sw3rfst$B"
|
|
// CHECK-DAG: @_T0SqMF = internal constant {{.*}}, section ".sw3flmd$B"
|
|
// CHECK-DAG: @_T0s1SVs1PsMA = internal constant {{.*}}, section ".sw3asty$B"
|
|
// CHECK-DAG: @_T0BoMB = internal constant {{.*}}, section ".sw3bltn$B"
|
|
|