From 4e719e49b9843fd85ff0ba628afc37ece0e5942e Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 4 Mar 2020 14:57:48 +0100 Subject: [PATCH 1/6] Third RC release --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index ad1416b9..62a35718 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-10 (1:10.0.0~+rc3-1) unstable; urgency=medium + + * Third RC release + + -- Sylvestre Ledru Wed, 04 Mar 2020 14:56:12 +0100 + llvm-toolchain-10 (1:10.0.0~+rc2-3) unstable; urgency=medium * Disable libfuzzer on x86 From de29f38ec9d2a1f2a82e3445f1994d82700206e5 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 8 Mar 2020 09:47:08 +0100 Subject: [PATCH 2/6] Disable the emmintrin.h build test in qualify-clang.sh on arm64 --- debian/changelog | 6 ++++++ debian/qualify-clang.sh | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 62a35718..274c4f15 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-10 (1:10.0.0~+rc3-2) unstable; urgency=medium + + * Disable the emmintrin.h build test in qualify-clang.sh on arm64 + + -- Sylvestre Ledru Sun, 08 Mar 2020 09:46:59 +0100 + llvm-toolchain-10 (1:10.0.0~+rc3-1) unstable; urgency=medium * Third RC release diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 372604a1..1bcbdf77 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -114,8 +114,12 @@ if test $NBLINES -lt 100; then exit 42 fi -echo '#include ' > foo.cc -clang++-$VERSION -c foo.cc +if [ $DEB_HOST_ARCH != "arm64" ]; then + # Fails on arm64 with + # /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:33:5: error: use of undeclared identifier '__builtin_ia32_emms'; did you mean '__builtin_isless'? + echo '#include ' > foo.cc + clang++-$VERSION -c foo.cc +fi # Bug 913213 echo '#include ' | clang-$VERSION -E - > /dev/null From 943e638261f181eb0580dc37dfe284cd9ae6c939 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 9 Mar 2020 19:02:16 +0100 Subject: [PATCH 3/6] add tests for clangd --- debian/changelog | 1 + debian/qualify-clang.sh | 66 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/debian/changelog b/debian/changelog index 274c4f15..59ecf257 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ llvm-toolchain-10 (1:10.0.0~+rc3-2) unstable; urgency=medium * Disable the emmintrin.h build test in qualify-clang.sh on arm64 + * Add some tests for clangd usage -- Sylvestre Ledru Sun, 08 Mar 2020 09:46:59 +0100 diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 1bcbdf77..0133379c 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -80,6 +80,72 @@ if ! grep -q "nested namespaces can " foo.log; then cat foo.log exit 1 fi +echo "Testing clangd-$VERSION ..." + +echo '{ + "jsonrpc": "2.0", + "id": 0, + "method": "initialize", + "params": { + "processId": 123, + "rootPath": "clangd-10", + "capabilities": { + "textDocument": { + "completion": { + "completionItem": { + "snippetSupport": true + } + } + } + }, + "trace": "off" + } +} +--- +{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"int func_with_args(int a, int b);\nint main() {\nfunc_with\n}"}}} +--- +{"jsonrpc":"2.0","id":1,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":2,"character":7}}} +--- +{"jsonrpc":"2.0","id":4,"method":"shutdown"} +--- +{"jsonrpc":"2.0","method":"exit"} +' > a.json + +clangd-$VERSION -lit-test -pch-storage=memory < a.json &> foo.log +if ! grep -q '"insertText": "func_with_args(${1:int a}, ${2:int b})",' foo.log; then + echo "clangd didn't export what we were expecting" + cat foo.log + exit 1 +fi + +rm -rf cmaketest && mkdir cmaketest +cat > cmaketest/CMakeLists.txt < /dev/null +# TODO this test is useless as it doesn't leverage foo.cpp or the compiledb +clangd-$VERSION -lit-test -pch-storage=memory < a.json &> foo.log +if ! grep -q '"insertText": "func_with_args(${1:int a}, ${2:int b})",' foo.log; then + echo "clangd didn't export what we were expecting" + cat foo.log + exit 1 +fi +cd - +rm -rf cmaketest + + + + + echo "Testing clang-$VERSION ..." From 1b55b27aeee4881c2192e92eb8719e813b4ad3ce Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 10 Mar 2020 15:52:46 +0100 Subject: [PATCH 4/6] clangd with a cmake test --- debian/qualify-clang.sh | 48 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 0133379c..04b6e0a9 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -118,6 +118,48 @@ if ! grep -q '"insertText": "func_with_args(${1:int a}, ${2:int b})",' foo.log; exit 1 fi +echo 'namespace mozilla { +namespace dom { +void foo(); + +int fonction_avec_args(int a, float b); +int main() { +fonction_avec_args +} + +} +} +' > foo.cpp +content=$(sed ':a;N;$!ba;s/\n/\\n/g' foo.cpp) +echo '{ + "jsonrpc": "2.0", + "id": 0, + "method": "initialize", + "params": { + "processId": 123, + "rootPath": "clangd-10", + "capabilities": { + "textDocument": { + "completion": { + "completionItem": { + "snippetSupport": true + } + } + } + }, + "trace": "off" + } +} +--- +{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///'$(pwd)'/cmaketest/foo.cpp","languageId":"cpp","version":1,"text":"'$content'"}}} +--- +{"jsonrpc":"2.0","id":1,"method":"textDocument/completion","params":{"textDocument":{"uri":"file:///'$(pwd)'/cmaketest/foo.cpp"},"position":{"line":6,"character":18}}} +--- +{"jsonrpc":"2.0","id":4,"method":"shutdown"} +--- +{"jsonrpc":"2.0","method":"exit"} +' > a.json + rm -rf cmaketest && mkdir cmaketest cat > cmaketest/CMakeLists.txt < /dev/null # TODO this test is useless as it doesn't leverage foo.cpp or the compiledb clangd-$VERSION -lit-test -pch-storage=memory < a.json &> foo.log -if ! grep -q '"insertText": "func_with_args(${1:int a}, ${2:int b})",' foo.log; then +if ! grep -q '"insertText": "fonction_avec_args(${1:int a}, ${2:float b})",' foo.log; then echo "clangd didn't export what we were expecting" cat foo.log exit 1 @@ -143,10 +185,6 @@ cd - rm -rf cmaketest - - - - echo "Testing clang-$VERSION ..." rm -f foo.log From 5f37790dd3458febf3aea49828107526f8d73569 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 10 Mar 2020 16:00:27 +0100 Subject: [PATCH 5/6] clang-tidy: add a test for the autofix --- debian/qualify-clang.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 04b6e0a9..22850fe0 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -80,6 +80,29 @@ if ! grep -q "nested namespaces can " foo.log; then cat foo.log exit 1 fi + + +rm -rf cmaketest && mkdir cmaketest +cat > cmaketest/CMakeLists.txt < /dev/null + +clang-tidy-$VERSION -checks='modernize-concat-nested-namespaces' ../foo.cpp -extra-arg=-std=c++17 -fix &> foo.log +if ! grep -q "namespace mozilla::dom" ../foo.cpp; then + echo "clang-tidy autofix didn't work" + cat foo.log + exit 1 +fi +cd - +rm -rf cmaketest + echo "Testing clangd-$VERSION ..." echo '{ From ff74df16132e48cca218865d23027ad76882c00c Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 10 Mar 2020 16:00:55 +0100 Subject: [PATCH 6/6] fix rootpath for clangd --- debian/qualify-clang.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 22850fe0..b89988a4 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -111,7 +111,7 @@ echo '{ "method": "initialize", "params": { "processId": 123, - "rootPath": "clangd-10", + "rootPath": "clangd", "capabilities": { "textDocument": { "completion": { @@ -160,7 +160,7 @@ echo '{ "method": "initialize", "params": { "processId": 123, - "rootPath": "clangd-10", + "rootPath": "clangd", "capabilities": { "textDocument": { "completion": {