File: xref-nested-clang-type.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 (54 lines) | stat: -rw-r--r-- 2,276 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
50
51
52
53
54
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t -I %S/Inputs/xref-nested-clang-type/ %s -module-name Lib
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -I %t -I %S/Inputs/xref-nested-clang-type/ %s -DCLIENT -verify

// RUN: %empty-directory(%t)
// RUN: cp %S/Inputs/xref-nested-clang-type/NestedClangTypes.h %t
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t -enable-objc-interop -disable-objc-attr-requires-foundation-module -import-objc-header %t/NestedClangTypes.h -I %S/Inputs/xref-nested-clang-type/ %s -module-name Lib -DNO_MODULE
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -I %t -I %S/Inputs/xref-nested-clang-type/ -enable-objc-interop -disable-objc-attr-requires-foundation-module -import-objc-header %t/NestedClangTypes.h %s -DCLIENT -verify

// RUN: %empty-directory(%t)
// RUN: cp %S/Inputs/xref-nested-clang-type/NestedClangTypes.h %t
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module -o %t -enable-objc-interop -disable-objc-attr-requires-foundation-module -import-objc-header %t/NestedClangTypes.h -I %S/Inputs/xref-nested-clang-type/ -pch-output-dir %t/PCHCache %s -module-name Lib -DNO_MODULE
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -I %t -I %S/Inputs/xref-nested-clang-type/ -pch-output-dir %t/PCHCache -enable-objc-interop -disable-objc-attr-requires-foundation-module -import-objc-header %t/NestedClangTypes.h %s -DCLIENT -verify

#if _runtime(_ObjC)
import Foundation
#endif // ObjC

#if CLIENT

import Lib

func test(x: MyInner) {}
func test(x: MyOtherInner) {}
func test(x: MyCode) {}

#else // CLIENT

#if !NO_MODULE
import NestedClangTypes
#endif

public typealias MyOuter = Outer
public typealias MyInner = Outer.InterestingValue

extension MyOuter {
  public func use(inner: MyInner) {}
}

public typealias MyOtherInner = OuterFromOtherModule.InterestingValue
extension OuterFromOtherModule {
  public func use(inner: MyOtherInner) {}
}

#if _runtime(_ObjC)
public typealias MyCode = ErrorCodeEnum.Code
extension ErrorCodeEnum {
  public func whatever(code: MyCode) {}
}
#else
public typealias MyCode = Int
#endif // ObjC

#endif // CLIENT