Author: Fangrui Song Date: 2024-05-03T09:39:17-07:00 New Revision: ac46eeaea8bc987e8a858a29d3b3e9e6539a81a8
URL: https://github.com/llvm/llvm-project/commit/ac46eeaea8bc987e8a858a29d3b3e9e6539a81a8 DIFF: https://github.com/llvm/llvm-project/commit/ac46eeaea8bc987e8a858a29d3b3e9e6539a81a8.diff LOG: [clang-tools-extra,test] Convert text files from CRLF to LF Skip files with intentional CRLF line endings: test/clang-apply-replacements/crlf.cpp test/clang-apply-replacements/Inputs/crlf/crlf.cpp.expected clangd/test/input-mirror.test clangd/test/protocol.test clangd/test/too-large.test Added: Modified: clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test clang-tools-extra/clangd/test/hover.test clang-tools-extra/clangd/test/spaces-in-delimited-input.test clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include.h clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include2.h clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/system/sys/types.h clang-tools-extra/test/clang-tidy/checkers/readability/else-after-return-if-constexpr.cpp clang-tools-extra/test/modularize/Inputs/CompileError/module.modulemap clang-tools-extra/test/modularize/Inputs/MissingHeader/module.modulemap clang-tools-extra/test/pp-trace/Inputs/module.modulemap Removed: ################################################################################ diff --git a/clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test b/clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test index bbbd72f8c59f6f..85a1f2199fadf9 100644 --- a/clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test +++ b/clang-tools-extra/clangd/test/delimited-input-comment-at-the-end.test @@ -1,11 +1,11 @@ -# RUN: clangd -input-style=delimited -sync -input-mirror-file %t < %s -# RUN: grep '{"jsonrpc":"2.0","id":3,"method":"exit"}' %t -# -# RUN: clangd -lit-test -input-mirror-file %t < %s -# RUN: grep '{"jsonrpc":"2.0","id":3,"method":"exit"}' %t -# -{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}} ---- -{"jsonrpc":"2.0","id":3,"method":"shutdown"} ---- -{"jsonrpc":"2.0","method":"exit"} +# RUN: clangd -input-style=delimited -sync -input-mirror-file %t < %s +# RUN: grep '{"jsonrpc":"2.0","id":3,"method":"exit"}' %t +# +# RUN: clangd -lit-test -input-mirror-file %t < %s +# RUN: grep '{"jsonrpc":"2.0","id":3,"method":"exit"}' %t +# +{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}} +--- +{"jsonrpc":"2.0","id":3,"method":"shutdown"} +--- +{"jsonrpc":"2.0","method":"exit"} diff --git a/clang-tools-extra/clangd/test/hover.test b/clang-tools-extra/clangd/test/hover.test index ec8d0488fa5ed1..dc76ae85fa41dd 100644 --- a/clang-tools-extra/clangd/test/hover.test +++ b/clang-tools-extra/clangd/test/hover.test @@ -1,57 +1,57 @@ -# RUN: clangd -lit-test < %s | FileCheck %s -{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}} ---- -{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"void foo(); int main() { foo(); }\n"}}} ---- -{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":0,"character":27}}} -# CHECK: "id": 1, -# CHECK-NEXT: "jsonrpc": "2.0", -# CHECK-NEXT: "result": { -# CHECK-NEXT: "contents": { -# CHECK-NEXT: "kind": "plaintext", -# CHECK-NEXT: "value": "function foo\n\n→ void\n\nvoid foo()" -# CHECK-NEXT: }, -# CHECK-NEXT: "range": { -# CHECK-NEXT: "end": { -# CHECK-NEXT: "character": 28, -# CHECK-NEXT: "line": 0 -# CHECK-NEXT: }, -# CHECK-NEXT: "start": { -# CHECK-NEXT: "character": 25, -# CHECK-NEXT: "line": 0 -# CHECK-NEXT: } -# CHECK-NEXT: } -# CHECK-NEXT: } -# CHECK-NEXT:} ---- -{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":0,"character":10}}} -# CHECK: "id": 1, -# CHECK-NEXT: "jsonrpc": "2.0", -# CHECK-NEXT: "result": null ---- -{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main2.cpp","languageId":"cpp","version":1,"text":"enum foo{}; int main() { foo f; }\n"}}} ---- -{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main2.cpp"},"position":{"line":0,"character":27}}} -# CHECK: "id": 1, -# CHECK-NEXT: "jsonrpc": "2.0", -# CHECK-NEXT: "result": { -# CHECK-NEXT: "contents": { -# CHECK-NEXT: "kind": "plaintext", -# CHECK-NEXT: "value": "enum foo\n\nenum foo {}" -# CHECK-NEXT: }, -# CHECK-NEXT: "range": { -# CHECK-NEXT: "end": { -# CHECK-NEXT: "character": 28, -# CHECK-NEXT: "line": 0 -# CHECK-NEXT: }, -# CHECK-NEXT: "start": { -# CHECK-NEXT: "character": 25, -# CHECK-NEXT: "line": 0 -# CHECK-NEXT: } -# CHECK-NEXT: } -# CHECK-NEXT: } -# CHECK-NEXT:} ---- -{"jsonrpc":"2.0","id":3,"method":"shutdown"} ---- -{"jsonrpc":"2.0","method":"exit"} +# RUN: clangd -lit-test < %s | FileCheck %s +{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}} +--- +{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"void foo(); int main() { foo(); }\n"}}} +--- +{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":0,"character":27}}} +# CHECK: "id": 1, +# CHECK-NEXT: "jsonrpc": "2.0", +# CHECK-NEXT: "result": { +# CHECK-NEXT: "contents": { +# CHECK-NEXT: "kind": "plaintext", +# CHECK-NEXT: "value": "function foo\n\n→ void\n\nvoid foo()" +# CHECK-NEXT: }, +# CHECK-NEXT: "range": { +# CHECK-NEXT: "end": { +# CHECK-NEXT: "character": 28, +# CHECK-NEXT: "line": 0 +# CHECK-NEXT: }, +# CHECK-NEXT: "start": { +# CHECK-NEXT: "character": 25, +# CHECK-NEXT: "line": 0 +# CHECK-NEXT: } +# CHECK-NEXT: } +# CHECK-NEXT: } +# CHECK-NEXT:} +--- +{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":0,"character":10}}} +# CHECK: "id": 1, +# CHECK-NEXT: "jsonrpc": "2.0", +# CHECK-NEXT: "result": null +--- +{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main2.cpp","languageId":"cpp","version":1,"text":"enum foo{}; int main() { foo f; }\n"}}} +--- +{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{"textDocument":{"uri":"test:///main2.cpp"},"position":{"line":0,"character":27}}} +# CHECK: "id": 1, +# CHECK-NEXT: "jsonrpc": "2.0", +# CHECK-NEXT: "result": { +# CHECK-NEXT: "contents": { +# CHECK-NEXT: "kind": "plaintext", +# CHECK-NEXT: "value": "enum foo\n\nenum foo {}" +# CHECK-NEXT: }, +# CHECK-NEXT: "range": { +# CHECK-NEXT: "end": { +# CHECK-NEXT: "character": 28, +# CHECK-NEXT: "line": 0 +# CHECK-NEXT: }, +# CHECK-NEXT: "start": { +# CHECK-NEXT: "character": 25, +# CHECK-NEXT: "line": 0 +# CHECK-NEXT: } +# CHECK-NEXT: } +# CHECK-NEXT: } +# CHECK-NEXT:} +--- +{"jsonrpc":"2.0","id":3,"method":"shutdown"} +--- +{"jsonrpc":"2.0","method":"exit"} diff --git a/clang-tools-extra/clangd/test/spaces-in-delimited-input.test b/clang-tools-extra/clangd/test/spaces-in-delimited-input.test index dc2e2f5ea0f64d..aa191b6f2097f9 100644 --- a/clang-tools-extra/clangd/test/spaces-in-delimited-input.test +++ b/clang-tools-extra/clangd/test/spaces-in-delimited-input.test @@ -1,13 +1,13 @@ -# RUN: clangd -input-style=delimited -sync < %s 2>&1 | FileCheck %s -# RUN: clangd -lit-test -sync < %s 2>&1 | FileCheck %s -# -{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}} - ---- - -{"jsonrpc":"2.0","id":3,"method":"shutdown"} - ---- - -{"jsonrpc":"2.0","method":"exit"} -# CHECK-NOT: JSON parse error +# RUN: clangd -input-style=delimited -sync < %s 2>&1 | FileCheck %s +# RUN: clangd -lit-test -sync < %s 2>&1 | FileCheck %s +# +{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}} + +--- + +{"jsonrpc":"2.0","id":3,"method":"shutdown"} + +--- + +{"jsonrpc":"2.0","method":"exit"} +# CHECK-NOT: JSON parse error diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include.h b/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include.h index bf288023274b15..22d3a3acbc916e 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include.h +++ b/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include.h @@ -1,15 +1,15 @@ -#ifndef READABILITY_DUPLICATE_INCLUDE_H -#define READABILITY_DUPLICATE_INCLUDE_H - -extern int g; -#include "duplicate-include2.h" -extern int h; -#include "duplicate-include2.h" -extern int i; -// CHECK-MESSAGES: :[[@LINE-2]]:1: warning: duplicate include -// CHECK-FIXES: {{^extern int g;$}} -// CHECK-FIXES-NEXT: {{^#include "duplicate-include2.h"$}} -// CHECK-FIXES-NEXT: {{^extern int h;$}} -// CHECK-FIXES-NEXT: {{^extern int i;$}} - -#endif +#ifndef READABILITY_DUPLICATE_INCLUDE_H +#define READABILITY_DUPLICATE_INCLUDE_H + +extern int g; +#include "duplicate-include2.h" +extern int h; +#include "duplicate-include2.h" +extern int i; +// CHECK-MESSAGES: :[[@LINE-2]]:1: warning: duplicate include +// CHECK-FIXES: {{^extern int g;$}} +// CHECK-FIXES-NEXT: {{^#include "duplicate-include2.h"$}} +// CHECK-FIXES-NEXT: {{^extern int h;$}} +// CHECK-FIXES-NEXT: {{^extern int i;$}} + +#endif diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include2.h b/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include2.h index 58dfa757ee7aed..fcbabe12fc378a 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include2.h +++ b/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/duplicate-include2.h @@ -1 +1 @@ -// This file is intentionally empty. +// This file is intentionally empty. diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/system/sys/types.h b/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/system/sys/types.h index 58dfa757ee7aed..fcbabe12fc378a 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/system/sys/types.h +++ b/clang-tools-extra/test/clang-tidy/checkers/readability/Inputs/duplicate-include/system/sys/types.h @@ -1 +1 @@ -// This file is intentionally empty. +// This file is intentionally empty. diff --git a/clang-tools-extra/test/clang-tidy/checkers/readability/else-after-return-if-constexpr.cpp b/clang-tools-extra/test/clang-tidy/checkers/readability/else-after-return-if-constexpr.cpp index 6532940eaf2314..1edb3237eaf4d6 100644 --- a/clang-tools-extra/test/clang-tidy/checkers/readability/else-after-return-if-constexpr.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/readability/else-after-return-if-constexpr.cpp @@ -1,22 +1,22 @@ -// RUN: %check_clang_tidy %s readability-else-after-return %t -- -- -std=c++17 - -// Constexpr if is an exception to the rule, we cannot remove the else. -void f() { - if (sizeof(int) > 4) - return; - else - return; - // CHECK-MESSAGES: [[@LINE-2]]:3: warning: do not use 'else' after 'return' - - if constexpr (sizeof(int) > 4) - return; - else - return; - - if constexpr (sizeof(int) > 4) - return; - else if constexpr (sizeof(long) > 4) - return; - else - return; -} +// RUN: %check_clang_tidy %s readability-else-after-return %t -- -- -std=c++17 + +// Constexpr if is an exception to the rule, we cannot remove the else. +void f() { + if (sizeof(int) > 4) + return; + else + return; + // CHECK-MESSAGES: [[@LINE-2]]:3: warning: do not use 'else' after 'return' + + if constexpr (sizeof(int) > 4) + return; + else + return; + + if constexpr (sizeof(int) > 4) + return; + else if constexpr (sizeof(long) > 4) + return; + else + return; +} diff --git a/clang-tools-extra/test/modularize/Inputs/CompileError/module.modulemap b/clang-tools-extra/test/modularize/Inputs/CompileError/module.modulemap index 64180adf5beb35..f71b66f148ed19 100644 --- a/clang-tools-extra/test/modularize/Inputs/CompileError/module.modulemap +++ b/clang-tools-extra/test/modularize/Inputs/CompileError/module.modulemap @@ -1,10 +1,10 @@ -// module.modulemap - -module Level1A { - header "Level1A.h" - export * -} -module HasError { - header "HasError.h" - export * -} +// module.modulemap + +module Level1A { + header "Level1A.h" + export * +} +module HasError { + header "HasError.h" + export * +} diff --git a/clang-tools-extra/test/modularize/Inputs/MissingHeader/module.modulemap b/clang-tools-extra/test/modularize/Inputs/MissingHeader/module.modulemap index 9acb4923f9ac37..330e13f5ee1558 100644 --- a/clang-tools-extra/test/modularize/Inputs/MissingHeader/module.modulemap +++ b/clang-tools-extra/test/modularize/Inputs/MissingHeader/module.modulemap @@ -1,10 +1,10 @@ -// module.modulemap - -module Level1A { - header "Level1A.h" - export * -} -module Missing { - header "Missing.h" - export * -} +// module.modulemap + +module Level1A { + header "Level1A.h" + export * +} +module Missing { + header "Missing.h" + export * +} diff --git a/clang-tools-extra/test/pp-trace/Inputs/module.modulemap b/clang-tools-extra/test/pp-trace/Inputs/module.modulemap index f16bbc6e2e05b4..415c874f09d373 100644 --- a/clang-tools-extra/test/pp-trace/Inputs/module.modulemap +++ b/clang-tools-extra/test/pp-trace/Inputs/module.modulemap @@ -1,18 +1,18 @@ -// module.modulemap - -module Level1A { - header "Level1A.h" - export * -} -module Level1B { - header "Level1B.h" - export * - module Level2B { - header "Level2B.h" - export * - } -} -module Level2A { - header "Level2A.h" - export * -} +// module.modulemap + +module Level1A { + header "Level1A.h" + export * +} +module Level1B { + header "Level1B.h" + export * + module Level2B { + header "Level2B.h" + export * + } +} +module Level2A { + header "Level2A.h" + export * +} _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits