Fix GCC build problem with 288f05f related to SmallVector. (#116958)
[llvm-project.git] / mlir / test / mlir-pdll-lsp-server / view-output.test
blobc45ac2ed810fed680763dc5e1481d1458b1b29b5
1 // RUN: mlir-pdll-lsp-server -lit-test < %s | FileCheck -strict-whitespace %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"pdll","capabilities":{},"trace":"off"}}
3 // -----
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
5   "uri":"test:///foo.pdll",
6   "languageId":"pdll",
7   "version":1,
8   "text":"Pattern TestPat => erase op<test.op>;"
9 }}}
10 // -----
11 {"jsonrpc":"2.0","id":1,"method":"pdll/viewOutput","params":{
12   "uri":"test:///foo.pdll",
13   "kind":"ast"
15 //      CHECK:  "id": 1
16 // CHECK-NEXT:  "jsonrpc": "2.0",
17 // CHECK-NEXT:  "result": {
18 // CHECK-NEXT:    "output": "-Module{{.*}}PatternDecl{{.*}}Name<TestPat>{{.*}}\n"
19 // CHECK-NEXT:  }
20 // -----
21 {"jsonrpc":"2.0","id":2,"method":"pdll/viewOutput","params":{
22   "uri":"test:///foo.pdll",
23   "kind":"mlir"
25 //      CHECK:  "id": 2
26 // CHECK-NEXT:  "jsonrpc": "2.0",
27 // CHECK-NEXT:  "result": {
28 // CHECK-NEXT:    "output": "module {\n  pdl.pattern @TestPat {{.*}}\n"
29 // CHECK-NEXT:  }
30 // -----
31 {"jsonrpc":"2.0","id":3,"method":"pdll/viewOutput","params":{
32   "uri":"test:///foo.pdll",
33   "kind":"cpp"
35 //      CHECK:  "id": 3
36 // CHECK-NEXT:  "jsonrpc": "2.0",
37 // CHECK-NEXT:  "result": {
38 // CHECK-NEXT:    "output": "{{.*}}struct TestPat : ::mlir::PDLPatternModule{{.*}}\n"
39 // CHECK-NEXT:  }
40 // -----
41 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
42 // -----
43 {"jsonrpc":"2.0","method":"exit"}