forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcursor_info_param.swift
43 lines (33 loc) · 1.93 KB
/
cursor_info_param.swift
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
func simpleParams(a: Int, b theB: Int) {}
struct AccessorTest {
subscript(a: Int, b theB: Int) -> Int { return a }
var prop: Int {
get { return 0 }
set(v) {}
}
}
#sourceLocation(file: "custom.swuft", line: 2000)
func customSourceLocation(a: Int) {}
#sourceLocation()
// RUN: %sourcekitd-test -req=cursor -pos=1:19 %s -- %s | %FileCheck -check-prefix=CHECK-FUNC-A %s
// CHECK-FUNC-A: s:17cursor_info_param12simpleParams1a1bySi_SitFACL_Sivp
// CHECK-FUNC-A: PARENT OFFSET: 5
// RUN: %sourcekitd-test -req=cursor -pos=1:27 %s -- %s | %FileCheck -check-prefix=CHECK-FUNC-B %s
// CHECK-FUNC-B: s:17cursor_info_param12simpleParams1a1bySi_SitF{{$}}
// RUN: %sourcekitd-test -req=cursor -pos=1:29 %s -- %s | %FileCheck -check-prefix=CHECK-FUNC-THEB %s
// CHECK-FUNC-THEB: s:17cursor_info_param12simpleParams1a1bySi_SitF4theBL_Sivp
// CHECK-FUNC-THEB-NOT: PARENT OFFSET
// RUN: %sourcekitd-test -req=cursor -pos=4:13 %s -- %s | %FileCheck -check-prefix=CHECK-SUBSCRIPT-A %s
// CHECK-SUBSCRIPT-A: s:17cursor_info_param12AccessorTestV_1bS2i_Sitcip1aL_Sivp
// CHECK-SUBSCRIPT-A: PARENT OFFSET: 67
// RUN: %sourcekitd-test -req=cursor -pos=4:21 %s -- %s | %FileCheck -check-prefix=CHECK-SUBSCRIPT-B %s
// CHECK-SUBSCRIPT-B: s:17cursor_info_param12AccessorTestV
// RUN: %sourcekitd-test -req=cursor -pos=4:23 %s -- %s | %FileCheck -check-prefix=CHECK-SUBSCRIPT-THEB %s
// CHECK-SUBSCRIPT-THEB: s:17cursor_info_param12AccessorTestV_1bS2i_Sitcip4theBL_Sivp
// CHECK-SUBSCRIPT-THEB-NOT: PARENT OFFSET
// RUN: %sourcekitd-test -req=cursor -pos=7:9 %s -- %s | %FileCheck -check-prefix=CHECK-SETTER-V %s
// CHECK-SETTER-V: s:17cursor_info_param12AccessorTestV4propSivs1vL_Sivp
// CHECK-SETTER-V: PARENT OFFSET: 161
// RUN: %sourcekitd-test -req=cursor -pos=12:27 %s -- %s | %FileCheck -check-prefix=CHECK-CUSTOM-SOURCELOCATION %s
// CHECK-CUSTOM-SOURCELOCATION: s:17cursor_info_param20customSourceLocation1aySi_tFACL_Sivp
// CHECK-CUSTOM-SOURCELOCATION: PARENT OFFSET: 233