File tree 1 file changed +48
-0
lines changed 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t/src)
2
+ // RUN: split-file %s %t/src
3
+
4
+ /// Build LibA
5
+ // RUN: %host-build-swift %t/src/LibA.swift -swift-version 5 -emit-module -emit-library -enable-library-evolution -module-name LibA -o %t/%target-library-name(LibA) -emit-module-interface-path %t/LibA.swiftinterface
6
+
7
+ // Build LibB
8
+ // RUN: %target-build-swift %t/src/LibB.swift -I %t -L %t -l LibA -swift-version 5 -emit-module -emit-library -module-name LibB -o %t/%target-library-name(LibB)
9
+
10
+ // Build LibC
11
+ // RUN: %target-build-swift %t/src/LibC.swift -I %t -L %t -l LibA -swift-version 5 -emit-module -emit-library -module-name LibC -o %t/%target-library-name(LibC)
12
+
13
+ // Build & run main.swift
14
+ // RUN: %target-build-swift -I %t -L %t -l LibA -l LibB -l LibC %t/src/main.swift -o %t/a.out
15
+ // RUN: %target-codesign %t/%target-library-name(LibA)
16
+ // RUN: %target-codesign %t/%target-library-name(LibB)
17
+ // RUN: %target-codesign %t/%target-library-name(LibC)
18
+ // RUN: %target-codesign %t/a.out
19
+ // RUN: %target-run %t/a.out | %FileCheck %s
20
+
21
+ // REQUIRES: executable_test
22
+
23
+ //--- LibA.swift
24
+ public struct AStruct {
25
+ public static var property1 : Int = 1
26
+ public static var property2 : Int = 2
27
+ }
28
+
29
+ //--- LibB.swift
30
+ import LibA
31
+
32
+ public let keyPath1FromLibB = \AStruct . Type. property1
33
+ public let keyPath2FromLibB = \AStruct . Type. property2
34
+
35
+ //--- LibC.swift
36
+ import LibA
37
+
38
+ public let keyPath1FromLibC = \AStruct . Type. property1
39
+ public let keyPath2FromLibC = \AStruct . Type. property2
40
+
41
+ //--- main.swift
42
+ import LibB
43
+ import LibC
44
+
45
+ // CHECK: true
46
+ print ( keyPath1FromLibB == keyPath1FromLibC)
47
+ // CHECK: true
48
+ print ( keyPath1FromLibB != keyPath2FromLibC)
You can’t perform that action at this time.
0 commit comments