File: no-package-dependencies-on-non-package-interface-implicit.swift

package info (click to toggle)
swiftlang 6.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,532 kB
  • sloc: cpp: 9,901,743; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (35 lines) | stat: -rw-r--r-- 1,529 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/module-cache)
// RUN: %empty-directory(%t/Swift)
// RUN: %empty-directory(%t/OtherSwift)
// RUN: split-file %s %t

// Build in-package ModuleC
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/OtherSwift/ModuleC.swiftmodule -module-name ModuleC -package-name TestPak %t/C.swift

// Build in-package ModuleB
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/Swift/ModuleB.swiftmodule -enable-library-evolution -emit-module-interface-path %t/Swift/ModuleB.swiftinterface  -module-name ModuleB -package-name TestPak %t/B.swift -I%t/OtherSwift

// Build in-package ModuleA
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/Swift/ModuleA.swiftmodule -enable-library-evolution -emit-module-interface-path %t/Swift/ModuleA.swiftinterface -module-name ModuleA -package-name TestPak %t/A.swift -I%t/Swift -I%t/OtherSwift

// Remove binary module for A to make sure an implicit interface compile gets triggered
// RUN: rm %t/Swift/ModuleA.swiftmodule
// Remove in-package-only dependency of B to ensure that if the compiler looks for it, compilation will fail
// RUN: rm %t/OtherSwift/ModuleC.swiftmodule

// Build out-of-package client source
// RUN: %target-swift-frontend -emit-module -emit-module-path %t/Swift/Client.swiftmodule -module-name Client %t/Client.swift -I%t/Swift

//--- C.swift
public func c() {}

//--- B.swift
package import ModuleC

//--- A.swift
@_exported public import ModuleB

//--- Client.swift
import ModuleA