std.crypto: make ff.ct_unprotected.limbsCmpLt compile (#19741)
[zig.git] / ci / x86_64-windows-debug.ps1
blob6f8039883df41e8336302cc9563c054ab4db1f2c
1 $TARGET = "$($Env:ARCH)-windows-gnu"
2 $ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.12.0-dev.2073+402fe565a"
3 $MCPU = "baseline"
4 $PREFIX_PATH = "$($Env:USERPROFILE)\$ZIG_LLVM_CLANG_LLD_NAME"
5 $ZIG = "$PREFIX_PATH\bin\zig.exe"
6 $ZIG_LIB_DIR = "$(Get-Location)\lib"
8 function CheckLastExitCode {
9 if (!$?) {
10 exit 1
12 return 0
15 # Make the `zig version` number consistent.
16 # This will affect the `zig build` command below which uses `git describe`.
17 git fetch --tags
19 if ((git rev-parse --is-shallow-repository) -eq "true") {
20 git fetch --unshallow # `git describe` won't work on a shallow repo
23 Write-Output "Building from source..."
24 Remove-Item -Path 'build-debug' -Recurse -Force -ErrorAction Ignore
25 New-Item -Path 'build-debug' -ItemType Directory
26 Set-Location -Path 'build-debug'
28 # CMake gives a syntax error when file paths with backward slashes are used.
29 # Here, we use forward slashes only to work around this.
30 & cmake .. `
31 -GNinja `
32 -DCMAKE_INSTALL_PREFIX="stage3-debug" `
33 -DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" `
34 -DCMAKE_BUILD_TYPE=Debug `
35 -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `
36 -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" `
37 -DCMAKE_AR="$($ZIG -Replace "\\", "/")" `
38 -DZIG_AR_WORKAROUND=ON `
39 -DZIG_TARGET_TRIPLE="$TARGET" `
40 -DZIG_TARGET_MCPU="$MCPU" `
41 -DZIG_STATIC=ON `
42 -DZIG_NO_LIB=ON
43 CheckLastExitCode
45 ninja install
46 CheckLastExitCode
48 Write-Output "Main test suite..."
49 & "stage3-debug\bin\zig.exe" build test docs `
50 --zig-lib-dir "$ZIG_LIB_DIR" `
51 --search-prefix "$PREFIX_PATH" `
52 -Dstatic-llvm `
53 -Dskip-non-native `
54 -Dskip-release `
55 -Denable-symlinks-windows
56 CheckLastExitCode
58 Write-Output "Build x86_64-windows-msvc behavior tests using the C backend..."
59 & "stage3-debug\bin\zig.exe" test `
60 ..\test\behavior.zig `
61 --zig-lib-dir "$ZIG_LIB_DIR" `
62 -ofmt=c `
63 -femit-bin="test-x86_64-windows-msvc.c" `
64 --test-no-exec `
65 -target x86_64-windows-msvc `
66 -lc
67 CheckLastExitCode
69 & "stage3-debug\bin\zig.exe" build-obj `
70 --zig-lib-dir "$ZIG_LIB_DIR" `
71 -ofmt=c `
72 -OReleaseSmall `
73 --name compiler_rt `
74 -femit-bin="compiler_rt-x86_64-windows-msvc.c" `
75 --dep build_options `
76 -target x86_64-windows-msvc `
77 --mod root ..\lib\compiler_rt.zig `
78 --mod build_options config.zig
79 CheckLastExitCode
81 Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
82 CheckLastExitCode
84 Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" `
85 -DevCmdArguments '-arch=x64 -no_logo' `
86 -StartInPath $(Get-Location)
87 CheckLastExitCode
89 Write-Output "Build and run behavior tests with msvc..."
90 & cl.exe -I..\lib test-x86_64-windows-msvc.c compiler_rt-x86_64-windows-msvc.c /W3 /Z7 -link -nologo -debug -subsystem:console kernel32.lib ntdll.lib libcmt.lib
91 CheckLastExitCode
93 & .\test-x86_64-windows-msvc.exe
94 CheckLastExitCode