on master help sign in
Add Batch syntax test
commit09631ed119d94504f6701326b2321569890160c6 authorR1tschY <r1tschy@posteo.de> dateTue 6 Oct 2020, 20:47 (6 years ago) parent9257c7c
3 files changed+144
tests/syntax-tests/highlighted/Batch/build.bat+59 tests/syntax-tests/source/Batch/LICENSE.md+26 tests/syntax-tests/source/Batch/build.bat+59
tests/syntax-tests/highlighted/Batch/build.batnew file+59
@@ -0,0 +1,59 @@
1+@echo off
2+
3+
4+:: Change to your LLVM installation
5+set "LLVMPath=C:\Program Files\LLVM"
6+:: Change to your Visual Studio 2017 installation
7+set "VSPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
8+set "VSVersion=14.10.25017"
9+:: Change to your Windows Kit version & installation
10+set "WinSDKVersion=10.0.15063.0"
11+set "WinSDKPath=C:\Program Files (x86)\Windows Kits\10"
12+:: Change this to your resulting exe
13+set "OUTPUT=test.exe"
14+
15+
16+:: Setup
17+set "VSBasePath=%VSPath%\VC\Tools\MSVC\%VSVersion%"
18+set "PATH=%PATH%;%LLVMPath%\bin;%VSBasePath%\bin\HostX64\x64"
19+
20+:: Compiler Flags
21+set CFLAGS= ^
22+ -std=c++14 -Wall -Wextra
23+
24+set CPPFLAGS= ^
25+ -I "%VSBasePath%\include" ^
26+ -I "%WinSDKPath%\Include\%WinSDKVersion%\shared" ^
27+ -I "%WinSDKPath%\Include\%WinSDKVersion%\ucrt" ^
28+ -I "%WinSDKPath%\Include\%WinSDKVersion%\um"
29+
30+
31+:: Linker Libs
32+set LDFLAGS= ^
33+ -machine:x64 ^
34+ -nodefaultlib ^
35+ -subsystem:console
36+
37+set LDLIBS= ^
38+ -libpath:"%VSBasePath%\lib\x64" ^
39+ -libpath:"%WinSDKPath%\Lib\%WinSDKVersion%\ucrt\x64" ^
40+ -libpath:"%WinSDKPath%\Lib\%WinSDKVersion%\um\x64" ^
41+ libucrt.lib libvcruntime.lib libcmt.lib libcpmt.lib ^
42+ legacy_stdio_definitions.lib oldnames.lib ^
43+ legacy_stdio_wide_specifiers.lib ^
44+ kernel32.lib User32.lib
45+
46+
47+:: Compiling
48+@echo on
49+@for %%f in (*.cc) do (
50+ clang++.exe "%%~f" -o "%%~nf.o" -c %CFLAGS%
51+)
52+
53+:: Linking
54+@set "LINK_FILES="
55+@for %%f in (*.o) do (
56+ @set "LINK_FILES=%LINK_FILES% %%~f"
57+)
58+
59+lld-link.exe %LINK_FILES% -out:"%OUTPUT%" %LDFLAGS% %LDLIBS%
tests/syntax-tests/source/Batch/LICENSE.mdnew file+26
@@ -0,0 +1,26 @@
1+The `build.bat` file has been added from https://github.com/Leandros/ClangOnWindows/blob/master/build.bat under the following license:
2+
3+This is free and unencumbered software released into the public domain.
4+
5+Anyone is free to copy, modify, publish, use, compile, sell, or
6+distribute this software, either in source code form or as a compiled
7+binary, for any purpose, commercial or non-commercial, and by any
8+means.
9+
10+In jurisdictions that recognize copyright laws, the author or authors
11+of this software dedicate any and all copyright interest in the
12+software to the public domain. We make this dedication for the benefit
13+of the public at large and to the detriment of our heirs and
14+successors. We intend this dedication to be an overt act of
15+relinquishment in perpetuity of all present and future rights to this
16+software under copyright law.
17+
18+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24+OTHER DEALINGS IN THE SOFTWARE.
25+
26+For more information, please refer to <http://unlicense.org>
tests/syntax-tests/source/Batch/build.batnew file+59
@@ -0,0 +1,59 @@
1+@echo off
2+
3+
4+:: Change to your LLVM installation
5+set "LLVMPath=C:\Program Files\LLVM"
6+:: Change to your Visual Studio 2017 installation
7+set "VSPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
8+set "VSVersion=14.10.25017"
9+:: Change to your Windows Kit version & installation
10+set "WinSDKVersion=10.0.15063.0"
11+set "WinSDKPath=C:\Program Files (x86)\Windows Kits\10"
12+:: Change this to your resulting exe
13+set "OUTPUT=test.exe"
14+
15+
16+:: Setup
17+set "VSBasePath=%VSPath%\VC\Tools\MSVC\%VSVersion%"
18+set "PATH=%PATH%;%LLVMPath%\bin;%VSBasePath%\bin\HostX64\x64"
19+
20+:: Compiler Flags
21+set CFLAGS= ^
22+ -std=c++14 -Wall -Wextra
23+
24+set CPPFLAGS= ^
25+ -I "%VSBasePath%\include" ^
26+ -I "%WinSDKPath%\Include\%WinSDKVersion%\shared" ^
27+ -I "%WinSDKPath%\Include\%WinSDKVersion%\ucrt" ^
28+ -I "%WinSDKPath%\Include\%WinSDKVersion%\um"
29+
30+
31+:: Linker Libs
32+set LDFLAGS= ^
33+ -machine:x64 ^
34+ -nodefaultlib ^
35+ -subsystem:console
36+
37+set LDLIBS= ^
38+ -libpath:"%VSBasePath%\lib\x64" ^
39+ -libpath:"%WinSDKPath%\Lib\%WinSDKVersion%\ucrt\x64" ^
40+ -libpath:"%WinSDKPath%\Lib\%WinSDKVersion%\um\x64" ^
41+ libucrt.lib libvcruntime.lib libcmt.lib libcpmt.lib ^
42+ legacy_stdio_definitions.lib oldnames.lib ^
43+ legacy_stdio_wide_specifiers.lib ^
44+ kernel32.lib User32.lib
45+
46+
47+:: Compiling
48+@echo on
49+@for %%f in (*.cc) do (
50+ clang++.exe "%%~f" -o "%%~nf.o" -c %CFLAGS%
51+)
52+
53+:: Linking
54+@set "LINK_FILES="
55+@for %%f in (*.o) do (
56+ @set "LINK_FILES=%LINK_FILES% %%~f"
57+)
58+
59+lld-link.exe %LINK_FILES% -out:"%OUTPUT%" %LDFLAGS% %LDLIBS%