test: Test the clang-scan-deps wrapper

This commit is contained in:
Martin Storsjö committed 2024-05-02 20:03:56 +03:00
1 parent 334794b40d
commit 6c748d21dd
3 files changed
+47 -2

No files matched your search

+2 -2
View File
@@ -266,7 +266,7 @@ jobs:
./build-all.sh $(pwd)/install/llvm-mingw --disable-clang-tools-extra --disable-lldb $ARGS
.github/workflows/store-version.sh install/llvm-mingw/versions.txt
./copy-msys-dependencies.sh $(pwd)/install/llvm-mingw ${{matrix.sys}}
./test-libcxx-module.sh $(pwd)/install/llvm-mingw
NATIVE=1 ./test-libcxx-module.sh $(pwd)/install/llvm-mingw
./run-tests.sh $(pwd)/install/llvm-mingw
cd install
NAME=llvm-mingw-$TAG-ucrt-msys2-${{matrix.sys}}
@@ -362,7 +362,7 @@ jobs:
- uses: actions/checkout@v4
- name: Run tests
run: |
./test-libcxx-module.sh /llvm-mingw
NATIVE=1 ./test-libcxx-module.sh /llvm-mingw
./run-tests.sh /llvm-mingw
./run-lldb-tests.sh /llvm-mingw
+6
View File
@@ -30,4 +30,10 @@ for arch in $ARCHS; do
# TODO: This should ideally use "$CXX -print-file-name=libc++.modules.json", then parse the json to find the relevant cppm file and include directory.
$arch-w64-mingw32-clang++ -I$PREFIX/share/libc++/v1 -std=gnu++23 -Wno-reserved-module-identifier -x c++-module -fmodule-output=std.pcm -o std.cppm.obj -c $PREFIX/share/libc++/v1/std.cppm
$arch-w64-mingw32-clang++ -I$PREFIX/share/libc++/v1 -std=gnu++23 -Wno-reserved-module-identifier -x c++-module -fmodule-output=std.compat.pcm -fmodule-file=std=std.pcm -o std.compat.cppm.obj -c $PREFIX/share/libc++/v1/std.compat.cppm
$arch-w64-mingw32-clang-scan-deps -format=p1689 -- $arch-w64-mingw32-clang++ -std=c++23 -c test/test-scan-deps.cpp -DEXPECT_$arch
done
if [ -n "$NATIVE" ]; then
# Test the unprefixed clang-scan-deps wrapper.
clang-scan-deps -format=p1689 -- clang++ -std=c++23 -c test/test-scan-deps.cpp -DEXPECT_$(clang++ -dumpmachine | sed 's/-.*//')
fi
+39
View File
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2024 Martin Storsjo
*
* This file is part of llvm-mingw.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
// Test that clang-scan-deps can locate c++ standard library headers
#include <version>
// Test that we have set the expected architecture defines.
#if defined(__x86_64__)
#ifndef EXPECT_x86_64
#include <intentionally-missing-header>
#endif
#elif defined(__i386__)
#ifndef EXPECT_i686
#include <intentionally-missing-header>
#endif
#elif defined(__aarch64__)
#ifndef EXPECT_aarch64
#include <intentionally-missing-header>
#endif
#elif defined(__arm__)
#ifndef EXPECT_armv7
#include <intentionally-missing-header>
#endif
#endif