File: gen_clang_module.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 (95 lines) | stat: -rw-r--r-- 7,126 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
import Foo

var x: FooClassBase

// REQUIRES: objc_interop

// FIXME: the test output we're comparing to is specific to macOS.
// REQUIRES: OS=macosx

// RUN: %empty-directory(%t.overlays)
// RUN: %empty-directory(%t)
// RUN: %build-clang-importer-objc-overlays
//
// RUN: %target-swift-frontend -emit-module -o %t.overlays -F %S/../Inputs/libIDE-mock-sdk %S/Inputs/Foo.swift -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import
//
// RUN: %sourcekitd-test -req=interface-gen -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN:         -target %target-triple %clang-importer-sdk-nosource -I %t > %t.response
// RUN: %diff -u %s.response %t.response

// RUN: %sourcekitd-test -req=interface-gen -module Foo.FooSub -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN:         -target %target-triple %clang-importer-sdk-nosource -I %t > %t.sub.response
// RUN: %diff -u %s.sub.response %t.sub.response

// RUN: %sourcekitd-test -req=interface-gen -module FooHelper -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN:         -target %target-triple %clang-importer-sdk-nosource -I %t > %t.helper.response
// RUN: %diff -u %s.helper.response %t.helper.response

// RUN: %sourcekitd-test -req=interface-gen -module FooHelper.FooHelperExplicit -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  -I %t.overlays \
// RUN:         -F %S/../Inputs/libIDE-mock-sdk  -target %target-triple %clang-importer-sdk-nosource -I %t > %t.helper.explicit.response
// RUN: %diff -u %s.helper.explicit.response %t.helper.explicit.response

// RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN:         -target %target-triple %clang-importer-sdk-nosource -I %t \
// RUN:      == -req=cursor -pos=191:67 | %FileCheck -check-prefix=CHECK1 %s
// The cursor points to 'FooClassBase' inside the list of base classes, see 'gen_clang_module.swift.response'

// RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN:         -target %target-triple %clang-importer-sdk-nosource -I %t \
// RUN:   == -req=cursor -pos=3:11 %s -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  %s -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN:         -target %target-triple %clang-importer-sdk-nosource -I %t | %FileCheck -check-prefix=CHECK1 %s

// CHECK1: source.lang.swift.ref.class ({{.*}}Foo.framework/Headers/Foo.h:147:12-147:24)
// CHECK1: FooClassBase
// CHECK1: c:objc(cs)FooClassBase
// CHECK1: Foo{{$}}
// CHECK1-NEXT: /<interface-gen>

// RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN:         -target %target-triple %clang-importer-sdk-nosource -I %t \
// RUN:      == -req=cursor -pos=211:20 | %FileCheck -check-prefix=CHECK2 %s
// The cursor points inside the interface, see 'gen_clang_module.swift.response'

// CHECK2: source.lang.swift.decl.function.method.instance ({{.*}}Foo.framework/Headers/Foo.h:170:10-170:27)
// CHECK2: fooInstanceFunc0
// CHECK2: c:objc(cs)FooClassDerived(im)fooInstanceFunc0
// CHECK2: Foo{{$}}
// CHECK2-NEXT: /<interface-gen>

// RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN:         -target %target-triple %clang-importer-sdk-nosource -I %t \
// RUN:      == -req=find-usr -usr "c:objc(cs)FooClassDerived(im)fooInstanceFunc0" | %FileCheck -check-prefix=CHECK-USR %s
// The returned line:col points inside the interface, see 'gen_clang_module.swift.response'

// CHECK-USR: (211:15-211:33)

// RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN:         -target %target-triple %clang-importer-sdk-nosource -I %t \
// RUN:   == -req=find-interface -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  %s -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN:         -target %target-triple %clang-importer-sdk-nosource -I %t | %FileCheck -check-prefix=CHECK-IFACE %s

// CHECK-IFACE: DOC: (/<interface-gen>)
// CHECK-IFACE: ARGS: [-target {{.*}}-{{.*}} -sdk {{.*}} -F {{.*}}/libIDE-mock-sdk -I {{.*}}.overlays {{.*}} -module-cache-path {{.*}} ]

// RUN: %sourcekitd-test -req=interface-gen-open -module Foo -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  -I %t.overlays -F %S/../Inputs/libIDE-mock-sdk \
// RUN:         -target %target-triple %clang-importer-sdk-nosource -I %t \
// RUN:      == -req=cursor -pos=1:8 == -req=cursor -pos=1:12 \
// RUN:      == -req=cursor -pos=2:8 | %FileCheck -check-prefix=CHECK-IMPORT %s
// The cursors point to module names inside the imports, see 'gen_clang_module.swift.response'

// CHECK-IMPORT: 	  source.lang.swift.ref.module ()
// CHECK-IMPORT-NEXT: Foo{{$}}
// CHECK-IMPORT-NEXT: Foo{{$}}
// CHECK-IMPORT: 	  source.lang.swift.ref.module ()
// CHECK-IMPORT-NEXT: FooSub{{$}}
// CHECK-IMPORT-NEXT: Foo.FooSub{{$}}
// CHECK-IMPORT: 	  source.lang.swift.ref.module ()
// CHECK-IMPORT-NEXT: FooHelper{{$}}
// CHECK-IMPORT-NEXT: FooHelper{{$}}

// RUN: %sourcekitd-test -req=interface-gen -module APINotesTests -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  -swift-version 4 -F %S/Inputs/mock-sdk \
// RUN:         -target %target-triple %clang-importer-sdk-nosource > %t.apinotes_swift3.response
// RUN: %diff -u %s.apinotes_swift3.response %t.apinotes_swift3.response
// RUN: %sourcekitd-test -req=interface-gen -module APINotesTests -- -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import  -swift-version 5 -F %S/Inputs/mock-sdk \
// RUN:         -target %target-triple %clang-importer-sdk-nosource > %t.apinotes_swift4.response
// RUN: %diff -u %s.apinotes_swift4.response %t.apinotes_swift4.response