[llvm][llvm-readobj] Add NT_ARM_GCS Linux core note type (#117545)
[llvm-project.git] / mlir / test / mlir-lsp-server / references.test
bloba94d752ab9d2a66286272b611073534acdf390c2
1 // RUN: mlir-lsp-server -lit-test < %s | FileCheck -strict-whitespace %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"mlir","capabilities":{},"trace":"off"}}
3 // -----
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
5   "uri":"test:///foo.mlir",
6   "languageId":"mlir",
7   "version":1,
8   "text":"#attr = 1 : index\n!type = index\nfunc.func @foo(%arg0: !type) -> i1 attributes {attr = #attr} {\n%value = arith.constant true\n%result = call @foo(%arg0) : (!type) -> i1\nreturn %value : i1 loc(#loc)\n}\n#loc = loc(\"foo.mlir\":1:2)"
9 }}}
10 // -----
11 {"jsonrpc":"2.0","id":1,"method":"textDocument/references","params":{
12   "textDocument":{"uri":"test:///foo.mlir"},
13   "position":{"line":3,"character":2},
14   "context":{"includeDeclaration": false}
16 //      CHECK:  "id": 1
17 // CHECK-NEXT:  "jsonrpc": "2.0",
18 // CHECK-NEXT:  "result": [
19 // CHECK-NEXT:    {
20 // CHECK-NEXT:      "range": {
21 // CHECK-NEXT:        "end": {
22 // CHECK-NEXT:          "character": 6,
23 // CHECK-NEXT:          "line": 3
24 // CHECK-NEXT:        },
25 // CHECK-NEXT:        "start": {
26 // CHECK-NEXT:          "character": 0,
27 // CHECK-NEXT:          "line": 3
28 // CHECK-NEXT:        }
29 // CHECK-NEXT:      },
30 // CHECK-NEXT:      "uri": "{{.*}}/foo.mlir"
31 // CHECK-NEXT:    },
32 // CHECK-NEXT:    {
33 // CHECK-NEXT:      "range": {
34 // CHECK-NEXT:        "end": {
35 // CHECK-NEXT:          "character": 13,
36 // CHECK-NEXT:          "line": 5
37 // CHECK-NEXT:        },
38 // CHECK-NEXT:        "start": {
39 // CHECK-NEXT:          "character": 7,
40 // CHECK-NEXT:          "line": 5
41 // CHECK-NEXT:        }
42 // CHECK-NEXT:      },
43 // CHECK-NEXT:      "uri": "{{.*}}/foo.mlir"
44 // CHECK-NEXT:    }
45 // CHECK-NEXT:  ]
46 // -----
47 {"jsonrpc":"2.0","id":2,"method":"textDocument/references","params":{
48   "textDocument":{"uri":"test:///foo.mlir"},
49   "position":{"line":2,"character":12},
50   "context":{"includeDeclaration": false}
52 //      CHECK:  "id": 2
53 // CHECK-NEXT:  "jsonrpc": "2.0",
54 // CHECK-NEXT:  "result": [
55 // CHECK-NEXT:    {
56 // CHECK-NEXT:      "range": {
57 // CHECK-NEXT:        "end": {
58 // CHECK-NEXT:          "character": 14,
59 // CHECK-NEXT:          "line": 2
60 // CHECK-NEXT:        },
61 // CHECK-NEXT:        "start": {
62 // CHECK-NEXT:          "character": 10,
63 // CHECK-NEXT:          "line": 2
64 // CHECK-NEXT:        }
65 // CHECK-NEXT:      },
66 // CHECK-NEXT:      "uri": "{{.*}}/foo.mlir"
67 // CHECK-NEXT:    },
68 // CHECK-NEXT:    {
69 // CHECK-NEXT:      "range": {
70 // CHECK-NEXT:        "end": {
71 // CHECK-NEXT:          "character": 19,
72 // CHECK-NEXT:          "line": 4
73 // CHECK-NEXT:        },
74 // CHECK-NEXT:        "start": {
75 // CHECK-NEXT:          "character": 15,
76 // CHECK-NEXT:          "line": 4
77 // CHECK-NEXT:        }
78 // CHECK-NEXT:      },
79 // CHECK-NEXT:      "uri": "{{.*}}/foo.mlir"
80 // CHECK-NEXT:    }
81 // CHECK-NEXT:  ]
82 // -----
83 {"jsonrpc":"2.0","id":2,"method":"textDocument/references","params":{
84   "textDocument":{"uri":"test:///foo.mlir"},
85   "position":{"line":0,"character":3},
86   "context":{"includeDeclaration": false}
88 //      CHECK:  "id": 2
89 // CHECK-NEXT:  "jsonrpc": "2.0",
90 // CHECK-NEXT:  "result": [
91 // CHECK-NEXT:    {
92 // CHECK-NEXT:      "range": {
93 // CHECK-NEXT:        "end": {
94 // CHECK-NEXT:          "character": 5,
95 // CHECK-NEXT:          "line": 0
96 // CHECK-NEXT:        },
97 // CHECK-NEXT:        "start": {
98 // CHECK-NEXT:          "character": 0,
99 // CHECK-NEXT:          "line": 0
100 // CHECK-NEXT:        }
101 // CHECK-NEXT:      },
102 // CHECK-NEXT:      "uri": "{{.*}}/foo.mlir"
103 // CHECK-NEXT:    },
104 // CHECK-NEXT:    {
105 // CHECK-NEXT:      "range": {
106 // CHECK-NEXT:        "end": {
107 // CHECK-NEXT:          "character": 59,
108 // CHECK-NEXT:          "line": 2
109 // CHECK-NEXT:        },
110 // CHECK-NEXT:        "start": {
111 // CHECK-NEXT:          "character": 54,
112 // CHECK-NEXT:          "line": 2
113 // CHECK-NEXT:        }
114 // CHECK-NEXT:      },
115 // CHECK-NEXT:      "uri": "{{.*}}/foo.mlir"
116 // CHECK-NEXT:    }
117 // CHECK-NEXT:  ]
118 // -----
119 {"jsonrpc":"2.0","id":2,"method":"textDocument/references","params":{
120   "textDocument":{"uri":"test:///foo.mlir"},
121   "position":{"line":1,"character":3},
122   "context":{"includeDeclaration": false}
124 //      CHECK:  "id": 2
125 // CHECK-NEXT:  "jsonrpc": "2.0",
126 // CHECK-NEXT:  "result": [
127 // CHECK-NEXT:    {
128 // CHECK-NEXT:      "range": {
129 // CHECK-NEXT:        "end": {
130 // CHECK-NEXT:          "character": 5,
131 // CHECK-NEXT:          "line": 1
132 // CHECK-NEXT:        },
133 // CHECK-NEXT:        "start": {
134 // CHECK-NEXT:          "character": 0,
135 // CHECK-NEXT:          "line": 1
136 // CHECK-NEXT:        }
137 // CHECK-NEXT:      },
138 // CHECK-NEXT:      "uri": "{{.*}}/foo.mlir"
139 // CHECK-NEXT:    },
140 // CHECK-NEXT:    {
141 // CHECK-NEXT:      "range": {
142 // CHECK-NEXT:        "end": {
143 // CHECK-NEXT:          "character": 27,
144 // CHECK-NEXT:          "line": 2
145 // CHECK-NEXT:        },
146 // CHECK-NEXT:        "start": {
147 // CHECK-NEXT:          "character": 22,
148 // CHECK-NEXT:          "line": 2
149 // CHECK-NEXT:        }
150 // CHECK-NEXT:      },
151 // CHECK-NEXT:      "uri": "{{.*}}/foo.mlir"
152 // CHECK-NEXT:    },
153 // CHECK-NEXT:    {
154 // CHECK-NEXT:      "range": {
155 // CHECK-NEXT:        "end": {
156 // CHECK-NEXT:          "character": 35,
157 // CHECK-NEXT:          "line": 4
158 // CHECK-NEXT:        },
159 // CHECK-NEXT:        "start": {
160 // CHECK-NEXT:          "character": 30,
161 // CHECK-NEXT:          "line": 4
162 // CHECK-NEXT:        }
163 // CHECK-NEXT:      },
164 // CHECK-NEXT:      "uri": "{{.*}}/foo.mlir"
165 // CHECK-NEXT:    }
166 // CHECK-NEXT:  ]
167 // -----
168 {"jsonrpc":"2.0","id":2,"method":"textDocument/references","params":{
169   "textDocument":{"uri":"test:///foo.mlir"},
170   "position":{"line":7,"character":3},
171   "context":{"includeDeclaration": false}
173 //      CHECK:  "id": 2
174 // CHECK-NEXT:  "jsonrpc": "2.0",
175 // CHECK-NEXT:  "result": [
176 // CHECK-NEXT:    {
177 // CHECK-NEXT:      "range": {
178 // CHECK-NEXT:        "end": {
179 // CHECK-NEXT:          "character": 4,
180 // CHECK-NEXT:          "line": 7
181 // CHECK-NEXT:        },
182 // CHECK-NEXT:        "start": {
183 // CHECK-NEXT:          "character": 0,
184 // CHECK-NEXT:          "line": 7
185 // CHECK-NEXT:        }
186 // CHECK-NEXT:      },
187 // CHECK-NEXT:      "uri": "{{.*}}/foo.mlir"
188 // CHECK-NEXT:    },
189 // CHECK-NEXT:    {
190 // CHECK-NEXT:      "range": {
191 // CHECK-NEXT:        "end": {
192 // CHECK-NEXT:          "character": 27,
193 // CHECK-NEXT:          "line": 5
194 // CHECK-NEXT:        },
195 // CHECK-NEXT:        "start": {
196 // CHECK-NEXT:          "character": 23,
197 // CHECK-NEXT:          "line": 5
198 // CHECK-NEXT:        }
199 // CHECK-NEXT:      },
200 // CHECK-NEXT:      "uri": "{{.*}}/foo.mlir"
201 // CHECK-NEXT:    }
202 // CHECK-NEXT:  ]
203 // -----
204 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
205 // -----
206 {"jsonrpc":"2.0","method":"exit"}