annotate clang/test/Index/arc-annotate.m @ 173:0572611fdcc8 llvm10 llvm12

reorgnization done
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 11:55:54 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 @interface A
anatofuz
parents:
diff changeset
2 @property (strong, nonatomic) id property;
anatofuz
parents:
diff changeset
3 @property (nonatomic, weak) id second_property;
anatofuz
parents:
diff changeset
4 @property (unsafe_unretained, nonatomic) id third_property;
anatofuz
parents:
diff changeset
5 @end
anatofuz
parents:
diff changeset
6
anatofuz
parents:
diff changeset
7 void foo() {
anatofuz
parents:
diff changeset
8 A *avar;
anatofuz
parents:
diff changeset
9 avar = 0;
anatofuz
parents:
diff changeset
10 }
anatofuz
parents:
diff changeset
11
anatofuz
parents:
diff changeset
12 // RUN: c-index-test -test-annotate-tokens=%s:1:1:11:1 %s -fobjc-arc -fobjc-nonfragile-abi | FileCheck %s
anatofuz
parents:
diff changeset
13 // CHECK: Punctuation: "@" [1:1 - 1:2] ObjCInterfaceDecl=A:1:12
anatofuz
parents:
diff changeset
14 // CHECK: Keyword: "interface" [1:2 - 1:11] ObjCInterfaceDecl=A:1:12
anatofuz
parents:
diff changeset
15 // CHECK: Identifier: "A" [1:12 - 1:13] ObjCInterfaceDecl=A:1:12
anatofuz
parents:
diff changeset
16 // CHECK: Punctuation: "@" [2:1 - 2:2] ObjCPropertyDecl=property:2:34
anatofuz
parents:
diff changeset
17 // CHECK: Keyword: "property" [2:2 - 2:10] ObjCPropertyDecl=property:2:34
anatofuz
parents:
diff changeset
18 // CHECK: Punctuation: "(" [2:11 - 2:12] ObjCPropertyDecl=property:2:34
anatofuz
parents:
diff changeset
19 // CHECK: Keyword: "strong" [2:12 - 2:18] ObjCPropertyDecl=property:2:34
anatofuz
parents:
diff changeset
20 // CHECK: Punctuation: "," [2:18 - 2:19] ObjCPropertyDecl=property:2:34
anatofuz
parents:
diff changeset
21 // CHECK: Keyword: "nonatomic" [2:20 - 2:29] ObjCPropertyDecl=property:2:34
anatofuz
parents:
diff changeset
22 // CHECK: Punctuation: ")" [2:29 - 2:30] ObjCPropertyDecl=property:2:34
anatofuz
parents:
diff changeset
23 // CHECK: Identifier: "id" [2:31 - 2:33] TypeRef=id:0:0
anatofuz
parents:
diff changeset
24 // CHECK: Identifier: "property" [2:34 - 2:42] ObjCPropertyDecl=property:2:34
anatofuz
parents:
diff changeset
25 // CHECK: Punctuation: ";" [2:42 - 2:43] ObjCInterfaceDecl=A:1:12
anatofuz
parents:
diff changeset
26 // CHECK: Punctuation: "@" [3:1 - 3:2] ObjCPropertyDecl=second_property:3:32
anatofuz
parents:
diff changeset
27 // CHECK: Keyword: "property" [3:2 - 3:10] ObjCPropertyDecl=second_property:3:32
anatofuz
parents:
diff changeset
28 // CHECK: Punctuation: "(" [3:11 - 3:12] ObjCPropertyDecl=second_property:3:32
anatofuz
parents:
diff changeset
29 // CHECK: Keyword: "nonatomic" [3:12 - 3:21] ObjCPropertyDecl=second_property:3:32
anatofuz
parents:
diff changeset
30 // CHECK: Punctuation: "," [3:21 - 3:22] ObjCPropertyDecl=second_property:3:32
anatofuz
parents:
diff changeset
31 // CHECK: Keyword: "weak" [3:23 - 3:27] ObjCPropertyDecl=second_property:3:32
anatofuz
parents:
diff changeset
32 // CHECK: Punctuation: ")" [3:27 - 3:28] ObjCPropertyDecl=second_property:3:32
anatofuz
parents:
diff changeset
33 // CHECK: Identifier: "id" [3:29 - 3:31] TypeRef=id:0:0
anatofuz
parents:
diff changeset
34 // CHECK: Identifier: "second_property" [3:32 - 3:47] ObjCPropertyDecl=second_property:3:32
anatofuz
parents:
diff changeset
35 // CHECK: Punctuation: "@" [4:1 - 4:2] ObjCPropertyDecl=third_property:4:45
anatofuz
parents:
diff changeset
36 // CHECK: Keyword: "property" [4:2 - 4:10] ObjCPropertyDecl=third_property:4:45
anatofuz
parents:
diff changeset
37 // CHECK: Punctuation: "(" [4:11 - 4:12] ObjCPropertyDecl=third_property:4:45
anatofuz
parents:
diff changeset
38 // CHECK: Keyword: "unsafe_unretained" [4:12 - 4:29] ObjCPropertyDecl=third_property:4:45
anatofuz
parents:
diff changeset
39 // CHECK: Punctuation: "," [4:29 - 4:30] ObjCPropertyDecl=third_property:4:45
anatofuz
parents:
diff changeset
40 // CHECK: Keyword: "nonatomic" [4:31 - 4:40] ObjCPropertyDecl=third_property:4:45
anatofuz
parents:
diff changeset
41 // CHECK: Punctuation: ")" [4:40 - 4:41] ObjCPropertyDecl=third_property:4:45
anatofuz
parents:
diff changeset
42 // CHECK: Identifier: "id" [4:42 - 4:44] TypeRef=id:0:0
anatofuz
parents:
diff changeset
43 // CHECK: Identifier: "third_property" [4:45 - 4:59] ObjCPropertyDecl=third_property:4:45
anatofuz
parents:
diff changeset
44
anatofuz
parents:
diff changeset
45 // CHECK: Identifier: "A" [8:3 - 8:4] ObjCClassRef=A:1:12
anatofuz
parents:
diff changeset
46 // CHECK: Punctuation: "*" [8:5 - 8:6] VarDecl=avar:8:6 (Definition)
anatofuz
parents:
diff changeset
47 // CHECK: Identifier: "avar" [8:6 - 8:10] VarDecl=avar:8:6 (Definition)
anatofuz
parents:
diff changeset
48 // CHECK: Punctuation: ";" [8:10 - 8:11] DeclStmt=
anatofuz
parents:
diff changeset
49 // CHECK: Identifier: "avar" [9:3 - 9:7] DeclRefExpr=avar:8:6
anatofuz
parents:
diff changeset
50 // CHECK: Punctuation: "=" [9:8 - 9:9] BinaryOperator=
anatofuz
parents:
diff changeset
51 // CHECK: Literal: "0" [9:10 - 9:11] IntegerLiteral=
anatofuz
parents:
diff changeset
52 // CHECK: Punctuation: ";" [9:11 - 9:12] CompoundStmt=
anatofuz
parents:
diff changeset
53
anatofuz
parents:
diff changeset
54 // RUN: c-index-test -file-refs-at=%s:8:8 %s -fobjc-arc -fobjc-nonfragile-abi | FileCheck %s -check-prefix=CHECK-REFS
anatofuz
parents:
diff changeset
55 // CHECK-REFS: VarDecl=avar:8:6 (Definition)
anatofuz
parents:
diff changeset
56 // CHECK-REFS: VarDecl=avar:8:6 (Definition) =[8:6 - 8:10]
anatofuz
parents:
diff changeset
57 // CHECK-REFS: DeclRefExpr=avar:8:6 =[9:3 - 9:7]