github: Run test-libcxx on aarch64 too

Now when using a version of llvm-mingw that checks out LLVM 21.x,
the libcxx tests pass on mingw/aarch64 (and mingw/armv7) as well,
so we can include this in the test matrix.

This requires setting CMAKE_CXX_COMPILER_TARGET manually; the LLVM
build system infers the wrong architecture when CMake is an
x86_64 binary. (The windows-11-arm images on Github Actions still
bundle an x86_64 CMake binary.)

(The wrong inferred architecture doesn't affect building libcxx,
but the wrong architecture gets passed as --target= parameter
when running the tests.)

Co-authored-by: Jeremy Drake <jeremyd2019@users.sourceforge.net>
Signed-off-by: Martin Storsjö <martin@martin.st>
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 702629c..dc56a55 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -177,13 +177,14 @@
 
   test-libcxx:
     needs: [llvm-mingw]
-    runs-on: windows-latest
     strategy:
       fail-fast: false
       matrix:
         include:
-          - { arch: x86_64, prefix: i686-w64-mingw32- }
-          - { arch: x86_64, prefix: }
+          - { arch: x86_64,  target_arch: i686    }
+          - { arch: x86_64,  target_arch: x86_64  }
+          - { arch: aarch64, target_arch: aarch64 }
+    runs-on: ${{startsWith(matrix.arch, 'a') && 'windows-11-arm' || 'windows-latest'}}
     steps:
       - name: Install dependencies
         run: |
@@ -219,15 +220,16 @@
             -DLIBCXX_ENABLE_WERROR=YES `
             -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" `
             -DLIBCXX_CXX_ABI=libcxxabi `
-            -DCMAKE_C_COMPILER=${{matrix.prefix}}clang `
-            -DCMAKE_CXX_COMPILER=${{matrix.prefix}}clang++ `
+            -DCMAKE_C_COMPILER=${{matrix.target_arch}}-w64-mingw32-clang `
+            -DCMAKE_CXX_COMPILER=${{matrix.target_arch}}-w64-mingw32-clang++ `
+            -DCMAKE_CXX_COMPILER_TARGET=${{matrix.target_arch}}-w64-windows-gnu `
             -DLIBCXXABI_ENABLE_SHARED=NO `
             -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES `
             -DLIBCXX_USE_COMPILER_RT=YES `
             -DLIBCXXABI_USE_COMPILER_RT=YES `
             -DLIBUNWIND_USE_COMPILER_RT=YES `
             -DLIBCXXABI_USE_LLVM_UNWINDER=YES `
-            -DLIBCXX_EXTRA_SITE_DEFINES="__USE_MINGW_ANSI_STDIO=1" `
+            -DLIBCXX_EXTRA_SITE_DEFINES="__USE_MINGW_ANSI_STDIO=${{startsWith(matrix.arch, 'a') && '0' || '1'}}" `
             -DCMAKE_INSTALL_MESSAGE=NEVER `
             -DLLVM_LIT_ARGS="-v --time-tests"
           ninja