From 09631ed119d94504f6701326b2321569890160c6 Mon Sep 17 00:00:00 2001 From: R1tschY Date: Tue, 6 Oct 2020 20:47:04 +0200 Subject: Add Batch syntax test --- tests/syntax-tests/highlighted/Batch/build.bat | 59 ++++++++++++++++++++++++++ tests/syntax-tests/source/Batch/LICENSE.md | 26 ++++++++++++ tests/syntax-tests/source/Batch/build.bat | 59 ++++++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 tests/syntax-tests/highlighted/Batch/build.bat create mode 100644 tests/syntax-tests/source/Batch/LICENSE.md create mode 100644 tests/syntax-tests/source/Batch/build.bat (limited to 'tests') diff --git a/tests/syntax-tests/highlighted/Batch/build.bat b/tests/syntax-tests/highlighted/Batch/build.bat new file mode 100644 index 00000000..a066dcc8 --- /dev/null +++ b/tests/syntax-tests/highlighted/Batch/build.bat @@ -0,0 +1,59 @@ +@echo off + + +:: Change to your LLVM installation +set "LLVMPath=C:\Program Files\LLVM" +:: Change to your Visual Studio 2017 installation +set "VSPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community" +set "VSVersion=14.10.25017" +:: Change to your Windows Kit version & installation +set "WinSDKVersion=10.0.15063.0" +set "WinSDKPath=C:\Program Files (x86)\Windows Kits\10" +:: Change this to your resulting exe +set "OUTPUT=test.exe" + + +:: Setup +set "VSBasePath=%VSPath%\VC\Tools\MSVC\%VSVersion%" +set "PATH=%PATH%;%LLVMPath%\bin;%VSBasePath%\bin\HostX64\x64" + +:: Compiler Flags +set CFLAGS= ^ + -std=c++14 -Wall -Wextra + +set CPPFLAGS= ^ + -I "%VSBasePath%\include" ^ + -I "%WinSDKPath%\Include\%WinSDKVersion%\shared" ^ + -I "%WinSDKPath%\Include\%WinSDKVersion%\ucrt" ^ + -I "%WinSDKPath%\Include\%WinSDKVersion%\um" + + +:: Linker Libs +set LDFLAGS= ^ + -machine:x64 ^ + -nodefaultlib ^ + -subsystem:console + +set LDLIBS= ^ + -libpath:"%VSBasePath%\lib\x64" ^ + -libpath:"%WinSDKPath%\Lib\%WinSDKVersion%\ucrt\x64" ^ + -libpath:"%WinSDKPath%\Lib\%WinSDKVersion%\um\x64" ^ + libucrt.lib libvcruntime.lib libcmt.lib libcpmt.lib ^ + legacy_stdio_definitions.lib oldnames.lib ^ + legacy_stdio_wide_specifiers.lib ^ + kernel32.lib User32.lib + + +:: Compiling +@echo on +@for %%f in (*.cc) do ( + clang++.exe "%%~f" -o "%%~nf.o" -c %CFLAGS% +) + +:: Linking +@set "LINK_FILES=" +@for %%f in (*.o) do ( + @set "LINK_FILES=%LINK_FILES% %%~f" +) + +lld-link.exe %LINK_FILES% -out:"%OUTPUT%" %LDFLAGS% %LDLIBS% diff --git a/tests/syntax-tests/source/Batch/LICENSE.md b/tests/syntax-tests/source/Batch/LICENSE.md new file mode 100644 index 00000000..299169db --- /dev/null +++ b/tests/syntax-tests/source/Batch/LICENSE.md @@ -0,0 +1,26 @@ +The `build.bat` file has been added from https://github.com/Leandros/ClangOnWindows/blob/master/build.bat under the following license: + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to \ No newline at end of file diff --git a/tests/syntax-tests/source/Batch/build.bat b/tests/syntax-tests/source/Batch/build.bat new file mode 100644 index 00000000..56a262e2 --- /dev/null +++ b/tests/syntax-tests/source/Batch/build.bat @@ -0,0 +1,59 @@ +@echo off + + +:: Change to your LLVM installation +set "LLVMPath=C:\Program Files\LLVM" +:: Change to your Visual Studio 2017 installation +set "VSPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community" +set "VSVersion=14.10.25017" +:: Change to your Windows Kit version & installation +set "WinSDKVersion=10.0.15063.0" +set "WinSDKPath=C:\Program Files (x86)\Windows Kits\10" +:: Change this to your resulting exe +set "OUTPUT=test.exe" + + +:: Setup +set "VSBasePath=%VSPath%\VC\Tools\MSVC\%VSVersion%" +set "PATH=%PATH%;%LLVMPath%\bin;%VSBasePath%\bin\HostX64\x64" + +:: Compiler Flags +set CFLAGS= ^ + -std=c++14 -Wall -Wextra + +set CPPFLAGS= ^ + -I "%VSBasePath%\include" ^ + -I "%WinSDKPath%\Include\%WinSDKVersion%\shared" ^ + -I "%WinSDKPath%\Include\%WinSDKVersion%\ucrt" ^ + -I "%WinSDKPath%\Include\%WinSDKVersion%\um" + + +:: Linker Libs +set LDFLAGS= ^ + -machine:x64 ^ + -nodefaultlib ^ + -subsystem:console + +set LDLIBS= ^ + -libpath:"%VSBasePath%\lib\x64" ^ + -libpath:"%WinSDKPath%\Lib\%WinSDKVersion%\ucrt\x64" ^ + -libpath:"%WinSDKPath%\Lib\%WinSDKVersion%\um\x64" ^ + libucrt.lib libvcruntime.lib libcmt.lib libcpmt.lib ^ + legacy_stdio_definitions.lib oldnames.lib ^ + legacy_stdio_wide_specifiers.lib ^ + kernel32.lib User32.lib + + +:: Compiling +@echo on +@for %%f in (*.cc) do ( + clang++.exe "%%~f" -o "%%~nf.o" -c %CFLAGS% +) + +:: Linking +@set "LINK_FILES=" +@for %%f in (*.o) do ( + @set "LINK_FILES=%LINK_FILES% %%~f" +) + +lld-link.exe %LINK_FILES% -out:"%OUTPUT%" %LDFLAGS% %LDLIBS% \ No newline at end of file -- cgit v1.2.3