diff --git a/debian/changelog b/debian/changelog index 2f7e68b7..80cc9780 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,19 @@ llvm-toolchain-snapshot (1:11~++20200123111717+04fd2041561-1~exp1) experimental; -- Sylvestre Ledru Thu, 23 Jan 2020 14:52:30 +0100 +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 + +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 diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 372604a1..b89988a4 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -81,6 +81,133 @@ if ! grep -q "nested namespaces can " foo.log; then 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 '{ + "jsonrpc": "2.0", + "id": 0, + "method": "initialize", + "params": { + "processId": 123, + "rootPath": "clangd", + "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 + +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", + "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": "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 +fi +cd - +rm -rf cmaketest + + echo "Testing clang-$VERSION ..." rm -f foo.log @@ -114,8 +241,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