File: move_to_extension_comove.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 (49 lines) | stat: -rw-r--r-- 1,559 bytes parent folder | download | duplicates (2)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// REQUIRES: OS=macosx
// RUN: %empty-directory(%t)

// RUN: %target-swift-frontend -typecheck %s -emit-tbd -emit-tbd-path %t/before_move.tbd -D BEFORE_MOVE -tbd-install_name FooCore -module-name Foo -enable-library-evolution -emit-sil -o %t/before_move.sil

// RUN: %llvm-nm %t/before_move.tbd | %FileCheck %s --check-prefix=CHECK-TBD 
// RUN: %FileCheck %s --check-prefix=CHECK-SIL < %t/before_move.sil

// RUN: %target-swift-frontend %s -emit-module -emit-module-path %t/FooCore.swiftmodule -D AFTER_MOVE_FOO_CORE -module-name FooCore -enable-library-evolution -tbd-install_name FooCore -emit-tbd -emit-tbd-path %t/after_move.tbd -emit-sil -o %t/after_move.sil

// RUN: %llvm-nm %t/after_move.tbd | %FileCheck %s --check-prefix=CHECK-TBD 
// RUN: %FileCheck %s --check-prefix=CHECK-SIL < %t/after_move.sil

// CHECK-TBD: _$s3Foo4DateC03SubB0V4yearAESi_tcfC
// CHECK-TBD: _$s3Foo4DateC03SubB0VMn

// CHECK-SIL: sil [available 10.7] @$s3Foo4DateC03SubB0V4yearAESi_tcfC : $@convention(method) (Int, @thin Date.SubDate.Type) -> @out Date.SubDate

#if BEFORE_MOVE

@available(OSX 10.7, *)
public class Date {
  public static func getCurrentYear() -> Int { return 2020 }
}

@available(OSX 10.7, *)
extension Date {
  public struct SubDate {
    public init(year: Int) {}
  }
}

#endif

#if AFTER_MOVE_FOO_CORE

@available(OSX 10.7, *)
@_originallyDefinedIn(module: "Foo", OSX 10.9)
public class Date {}

@available(OSX 10.7, *)
@_originallyDefinedIn(module: "Foo", OSX 10.9)
extension Date {
  public struct SubDate {
    public init(year: Int) {}
  }
}

#endif