Skip to content

Commit

Permalink
Test go to definition of control variable and limit variable of cilk_…
Browse files Browse the repository at this point in the history
…for loop
  • Loading branch information
VoxSciurorum authored and neboat committed Oct 20, 2024
1 parent 876a661 commit f78505e
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions clang-tools-extra/clangd/test/cilk_for.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# RUN: clangd -lit-test < %s | FileCheck %s
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off","initializationOptions":{"fallbackFlags":["-fopencilk"]}}}
---
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///for.c","languageId":"c","version":1,"text":"void f(int nn) {\n _Cilk_for(int ii = 99; ii < nn; ii += 1) { int jj = ii;}\n}"}}}
---
{"jsonrpc":"2.0","id":1,"method":"textDocument/definition","params":{"textDocument":{"uri":"test:///for.c"},"position":{"line":1,"character":25}}}
---
{"jsonrpc":"2.0","id":2,"method":"textDocument/definition","params":{"textDocument":{"uri":"test:///for.c"},"position":{"line":1,"character":31}}}
---
{"jsonrpc":"2.0","id":3,"method":"textDocument/definition","params":{"textDocument":{"uri":"test:///for.c"},"position":{"line":1,"character":35}}}
---
{"jsonrpc":"2.0","id":4,"method":"textDocument/definition","params":{"textDocument":{"uri":"test:///for.c"},"position":{"line":1,"character":54}}}
---
{"jsonrpc":"2.0","id":2,"method":"shutdown"}
---
{"jsonrpc":"2.0","method":"exit"}
# Find use of control variable inside loop condition.
# CHECK: "id": 1,
# CHECK-NEXT: "jsonrpc": "2.0",
# CHECK-NEXT: "result": [
# CHECK-NEXT: {
# CHECK-NEXT: "range": {
# CHECK-NEXT: "end": {
# CHECK-NEXT: "character": 18,
# CHECK-NEXT: "line": 1
# CHECK-NEXT: },
# CHECK-NEXT: "start": {
# CHECK-NEXT: "character": 16,
# CHECK-NEXT: "line": 1
# CHECK-NEXT: }
# CHECK-NEXT: },
# Find use of limit variable inside loop condition.
# CHECK: "id": 2,
# CHECK-NEXT: "jsonrpc": "2.0",
# CHECK-NEXT: "result": [
# CHECK-NEXT: {
# CHECK-NEXT: "range": {
# CHECK-NEXT: "end": {
# CHECK-NEXT: "character": 13,
# CHECK-NEXT: "line": 0
# CHECK-NEXT: },
# CHECK-NEXT: "start": {
# CHECK-NEXT: "character": 11,
# CHECK-NEXT: "line": 0
# CHECK-NEXT: }
# CHECK-NEXT: },
# Find use of control variable inside loop increment.
# CHECK: "id": 3,
# CHECK-NEXT: "jsonrpc": "2.0",
# CHECK-NEXT: "result": [
# CHECK-NEXT: {
# CHECK-NEXT: "range": {
# CHECK-NEXT: "end": {
# CHECK-NEXT: "character": 18,
# CHECK-NEXT: "line": 1
# CHECK-NEXT: },
# CHECK-NEXT: "start": {
# CHECK-NEXT: "character": 16,
# CHECK-NEXT: "line": 1
# CHECK-NEXT: }
# CHECK-NEXT: },
# Find use of control variable inside loop body.
# CHECK: "id": 4,
# CHECK-NEXT: "jsonrpc": "2.0",
# CHECK-NEXT: "result": [
# CHECK-NEXT: {
# CHECK-NEXT: "range": {
# CHECK-NEXT: "end": {
# CHECK-NEXT: "character": 18,
# CHECK-NEXT: "line": 1
# CHECK-NEXT: },
# CHECK-NEXT: "start": {
# CHECK-NEXT: "character": 16,
# CHECK-NEXT: "line": 1
# CHECK-NEXT: }
# CHECK-NEXT: },

0 comments on commit f78505e

Please sign in to comment.