File: print_clang_framework.swift

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (151 lines) | stat: -rw-r--r-- 9,988 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// TODO: Properties with unowned or weak ownership should not be bridged.
// XFAIL: *

// RUN: %empty-directory(%t)

// RUN: %target-swift-ide-test(mock-sdk: -F %S/Inputs/mock-sdk) -print-module -source-filename %s -module-to-print=Foo -function-definitions=false > %t/Foo.printed.txt
// RUN: diff -u %S/Inputs/mock-sdk/Foo.printed.txt %t/Foo.printed.txt

// RUN: %target-swift-ide-test(mock-sdk: -F %S/Inputs/mock-sdk) -print-interface -print-module -source-filename %s -module-to-print=Foo -function-definitions=false > %t/Foo.interface.printed.txt
// RUN: %FileCheck %s -check-prefix=INTERFACE1 < %t/Foo.interface.printed.txt

// RUN: %target-swift-ide-test(mock-sdk: -F %S/Inputs/mock-sdk) -print-module -source-filename %s -module-to-print=Foo -function-definitions=false -prefer-type-repr=true -module-print-submodules > %t/Foo.printed.recursive.txt
// RUN: diff -u %S/Inputs/mock-sdk/Foo.printed.recursive.txt %t/Foo.printed.recursive.txt

// RUN: %target-swift-ide-test(mock-sdk: -F %S/Inputs/mock-sdk) -print-module -source-filename %s -module-to-print=Foo.FooSub -function-definitions=false -prefer-type-repr=true > %t/Foo.FooSub.printed.txt
// RUN: diff -u %S/Inputs/mock-sdk/Foo.FooSub.printed.txt %t/Foo.FooSub.printed.txt

// RUN: %target-swift-ide-test(mock-sdk: -F %S/Inputs/mock-sdk) -print-module -source-filename %s -module-to-print=FooHelper -function-definitions=false -prefer-type-repr=true > %t/FooHelper.printed.txt
// RUN: diff -u %S/Inputs/mock-sdk/FooHelper.printed.txt %t/FooHelper.printed.txt

// RUN: %target-swift-ide-test(mock-sdk: -F %S/Inputs/mock-sdk) -print-module -source-filename %s -module-to-print=FooHelper.FooHelperSub -function-definitions=false -prefer-type-repr=true > %t/FooHelper.FooHelperSub.printed.txt
// RUN: diff -u %S/Inputs/mock-sdk/FooHelper.FooHelperSub.printed.txt %t/FooHelper.FooHelperSub.printed.txt

// RUN: %target-swift-ide-test(mock-sdk: -F %S/Inputs/mock-sdk) -print-module -source-filename %s -module-to-print=FooHelper.FooHelperExplicit -function-definitions=false -prefer-type-repr=true > %t/FooHelper.FooHelperExplicit.printed.txt
// RUN: diff -u %S/Inputs/mock-sdk/FooHelper.FooHelperExplicit.printed.txt %t/FooHelper.FooHelperExplicit.printed.txt

// RUN: %target-swift-ide-test(mock-sdk: -F %S/Inputs/mock-sdk) -print-module -source-filename %s -module-to-print=Foo -function-definitions=false -prefer-type-repr=true -annotate-print > %t/Foo.annotated.txt
// RUN: diff -u %S/Inputs/mock-sdk/Foo.annotated.txt %t/Foo.annotated.txt

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk -I %t) -emit-module -o %t %S/../Inputs/clang-importer-sdk/swift-modules/Foundation.swift
// RUN: %target-swift-ide-test(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -print-module -source-filename %s -module-to-print=Foundation -function-definitions=false -prefer-type-repr=true > %t.printed.txt
// RUN: %FileCheck %s -check-prefix=FOUNDATION -strict-whitespace < %t.printed.txt

// This test is in general platform-independent, but it happens to check
// printing of @available attributes for OS X, and those are not printed on
// iOS.
//
// FIXME: split OS X parts into a separate test.
//
// REQUIRES: OS=macosx

// FOUNDATION-LABEL: {{^}}/// Aaa.  NSAvailableOnOSX51AndIOS8_0.  Bbb.
// FOUNDATION-NEXT: {{^}}@available(OSX 51, *){{$}}

// FOUNDATION-LABEL: {{^}}/// Aaa.  NSPotentiallyUnavailableOptions.  Bbb.
// FOUNDATION-NEXT: {{^}}@available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}struct PotentiallyUnavailableOptions : OptionSet {{{$}}

// FOUNDATION-LABEL: {{^}}/// Aaa.  NSOptionsWithUnavailableElement.  Bbb.
// FOUNDATION-NEXT: {{^}}struct OptionsWithUnavailableElement : OptionSet {{{$}}
// FOUNDATION-NEXT: {{^}}  init(rawValue: UInt){{$}}
// FOUNDATION-NEXT: {{^}}  let rawValue: UInt{{$}}
// FOUNDATION-NEXT: {{^}}  static var first: OptionsWithUnavailableElement { get }{{$}}
// FOUNDATION-NEXT: {{^}}  static var second: OptionsWithUnavailableElement { get }{{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}  static var third: OptionsWithUnavailableElement { get }{{$}}

// FOUNDATION-LABEL: {{^}}/// Aaa.  NSUnavailableEnum.  Bbb.
// FOUNDATION-NEXT: {{^}}@available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}enum UnavailableEnum : UInt {{{$}}

// FOUNDATION-LABEL: {{^}}/// Aaa.  NSEnumWithUnavailableElement.  Bbb.
// FOUNDATION-NEXT: {{^}}enum EnumWithUnavailableElement : UInt {{{$}}
// FOUNDATION-NEXT: {{^}}  init?(rawValue: UInt){{$}}
// FOUNDATION-NEXT: {{^}}  var rawValue: UInt { get }{{$}}
// FOUNDATION-NEXT: {{^}}  case first{{$}}
// FOUNDATION-NEXT: {{^}}  case second{{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}  case third{{$}}

// FOUNDATION-LABEL: {{^}}/// Aaa.  UnannotatedFrameworkProtocol.  Bbb.
// FOUNDATION-NEXT: {{^}}protocol UnannotatedFrameworkProtocol {{{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}  func doSomething(with k: AnnotatedFrameworkClass?){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}  func doSomething(withNonNullableClass k: AnnotatedFrameworkClass){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}  func doSomething(withIUOClass k: AnnotatedFrameworkClass!){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}  func returnSomething() -> AnnotatedFrameworkClass?{{$}}
// FOUNDATION-NEXT: {{^}}  func noUnavailableTypesInSignature(){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 52, *){{$}}
// FOUNDATION-NEXT: {{^}}  func doSomething(with k: AnnotatedFrameworkClass, andLaterClass lk: AnnotatedLaterFrameworkClass){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 53, *)
// FOUNDATION-NEXT: {{^}}  func someMethodWithAvailability()
// FOUNDATION-NEXT: {{^}}  @available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}  var someProperty: AnnotatedFrameworkClass { get set }{{$}}

// FOUNDATION-LABEL: {{^}}/// Aaa.  AnnotatedFrameworkProtocol.  Bbb.
// FOUNDATION-NEXT: {{^}}@available(OSX 10.9, *){{$}}
// FOUNDATION-NEXT: {{^}}protocol AnnotatedFrameworkProtocol {{{$}}
// FOUNDATION-NEXT: {{^}}  func returnSomething() -> AnnotatedFrameworkClass?{{$}}

// FOUNDATION-LABEL: /// Aaa.  FrameworkClassConformingToUnannotatedFrameworkProtocol.  Bbb.
// FOUNDATION-NEXT: {{^}}class FrameworkClassConformingToUnannotatedFrameworkProtocol : NSObject, UnannotatedFrameworkProtocol {{{$}}
// FOUNDATION-NEXT: {{^}}  init(){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}  func doSomething(with k: AnnotatedFrameworkClass?){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}  func doSomething(withNonNullableClass k: AnnotatedFrameworkClass){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}  func doSomething(withIUOClass k: AnnotatedFrameworkClass!){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}  func returnSomething() -> AnnotatedFrameworkClass?{{$}}
// FOUNDATION-NEXT: {{^}}  func noUnavailableTypesInSignature(){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 52, *){{$}}
// FOUNDATION-NEXT: {{^}}  func doSomething(with k: AnnotatedFrameworkClass, andLaterClass lk: AnnotatedLaterFrameworkClass){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 53, *)
// FOUNDATION-NEXT: {{^}}  func someMethodWithAvailability()
// FOUNDATION-NEXT: {{^}}  @available(OSX 51, *){{$}}
// FOUNDATION-NEXT: {{^}}  var someProperty: AnnotatedFrameworkClass{{$}}

// FOUNDATION-LABEL: /// Aaa.  LaterFrameworkClassConformingToUnannotatedFrameworkProtocol.  Bbb.
// FOUNDATION-NEXT: {{^}}@available(OSX 52, *){{$}}
// FOUNDATION-NEXT: {{^}}class LaterFrameworkClassConformingToUnannotatedFrameworkProtocol : NSObject, UnannotatedFrameworkProtocol {{{$}}
// FOUNDATION-NEXT: {{^}}  init(){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 52, *){{$}}
// FOUNDATION-NEXT: {{^}}  func doSomething(with k: AnnotatedFrameworkClass?){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 52, *){{$}}
// FOUNDATION-NEXT: {{^}}  func doSomething(withNonNullableClass k: AnnotatedFrameworkClass){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 52, *){{$}}
// FOUNDATION-NEXT: {{^}}  func doSomething(withIUOClass k: AnnotatedFrameworkClass!){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 52, *){{$}}
// FOUNDATION-NEXT: {{^}}  func returnSomething() -> AnnotatedFrameworkClass?{{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 52, *){{$}}
// FOUNDATION-NEXT: {{^}}  func noUnavailableTypesInSignature(){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 52, *){{$}}
// FOUNDATION-NEXT: {{^}}  func doSomething(with k: AnnotatedFrameworkClass, andLaterClass lk: AnnotatedLaterFrameworkClass){{$}}
// FOUNDATION-NEXT: {{^}}  @available(OSX 53, *)
// FOUNDATION-NEXT: {{^}}  func someMethodWithAvailability()
// FOUNDATION-NEXT: {{^}}  @available(OSX 52, *){{$}}
// FOUNDATION-NEXT: {{^}}  var someProperty: AnnotatedFrameworkClass{{$}}
}

// FOUNDATION-LABEL: /// Aaa.  FrameworkClassConformingToLaterAnnotatedFrameworkProtocol.  Bbb.
// FOUNDATION-NEXT: {{^}}class FrameworkClassConformingToLaterAnnotatedFrameworkProtocol : NSObject, LaterAnnotatedFrameworkProtocol {
// FOUNDATION-NEXT: {{^}}  init()
// FOUNDATION-NEXT: {{^}}  @available(OSX 52, *)
// FOUNDATION-NEXT: {{^}}  func returnSomething() -> AnnotatedFrameworkClass?
// FOUNDATION-NEXT: {{^}}  @available(OSX 52, *)
// FOUNDATION-NEXT: {{^}}  func doSomething(with k: AnnotatedFrameworkClass, andLaterClass lk: AnnotatedLaterFrameworkClass)
// FOUNDATION-NEXT: {{^}}  @available(OSX 52, *)
// FOUNDATION-NEXT: {{^}}  func noUnavailableTypesInSignature()
// FOUNDATION-NEXT: {{^}}  @available(OSX 53, *)
// FOUNDATION-NEXT: {{^}}  func someMethodWithAvailability()
// FOUNDATION-NEXT: {{^}}  @available(OSX 52, *)
// FOUNDATION-NEXT: {{^}}  var someProperty: AnnotatedFrameworkClass
}

// INTERFACE1-NOT: unavailable
// INTERFACE1-NOT: This comment should not show without decl.