diff options
author | R1tschY <r1tschy@posteo.de> | 2020-10-06 20:47:04 +0200 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2020-10-07 07:41:42 +0200 |
commit | 09631ed119d94504f6701326b2321569890160c6 (patch) | |
tree | 2a4425b7629b9d1af82ed5a8f819bdc424da301d /tests | |
parent | 9257c7ce208e5362ee07e0b4e1aeed21226bcb29 (diff) |
Add Batch syntax test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/syntax-tests/highlighted/Batch/build.bat | 59 | ||||
-rw-r--r-- | tests/syntax-tests/source/Batch/LICENSE.md | 26 | ||||
-rw-r--r-- | tests/syntax-tests/source/Batch/build.bat | 59 |
3 files changed, 144 insertions, 0 deletions
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 @@ +[38;2;249;38;114m@[0m[38;2;249;38;114mecho[0m[38;2;248;248;242m off[0m + + +[38;2;117;113;94m::[0m[38;2;117;113;94m Change to your LLVM installation[0m +[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mLLVMPath[0m[38;2;249;38;114m=[0m[38;2;230;219;116mC:\Program Files\LLVM[0m[38;2;230;219;116m"[0m +[38;2;117;113;94m::[0m[38;2;117;113;94m Change to your Visual Studio 2017 installation[0m +[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mVSPath[0m[38;2;249;38;114m=[0m[38;2;230;219;116mC:\Program Files [0m[38;2;230;219;116m([0m[38;2;230;219;116mx86[0m[38;2;230;219;116m)[0m[38;2;230;219;116m\Microsoft Visual Studio\[0m[38;2;190;132;255m2017[0m[38;2;230;219;116m\Community[0m[38;2;230;219;116m"[0m +[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mVSVersion[0m[38;2;249;38;114m=[0m[38;2;190;132;255m14[0m[38;2;230;219;116m.[0m[38;2;190;132;255m10[0m[38;2;230;219;116m.[0m[38;2;190;132;255m25017[0m[38;2;230;219;116m"[0m +[38;2;117;113;94m::[0m[38;2;117;113;94m Change to your Windows Kit version & installation[0m +[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mWinSDKVersion[0m[38;2;249;38;114m=[0m[38;2;190;132;255m10[0m[38;2;230;219;116m.[0m[38;2;190;132;255m0[0m[38;2;230;219;116m.[0m[38;2;190;132;255m15063[0m[38;2;230;219;116m.[0m[38;2;190;132;255m0[0m[38;2;230;219;116m"[0m +[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mWinSDKPath[0m[38;2;249;38;114m=[0m[38;2;230;219;116mC:\Program Files [0m[38;2;230;219;116m([0m[38;2;230;219;116mx86[0m[38;2;230;219;116m)[0m[38;2;230;219;116m\Windows Kits\[0m[38;2;190;132;255m10[0m[38;2;230;219;116m"[0m +[38;2;117;113;94m::[0m[38;2;117;113;94m Change this to your resulting exe[0m +[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mOUTPUT[0m[38;2;249;38;114m=[0m[38;2;230;219;116mtest.exe[0m[38;2;230;219;116m"[0m + + +[38;2;117;113;94m::[0m[38;2;117;113;94m Setup[0m +[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mVSBasePath[0m[38;2;249;38;114m=[0m[38;2;255;255;255m%[0m[38;2;255;255;255mVSPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\VC\Tools\MSVC\[0m[38;2;255;255;255m%[0m[38;2;255;255;255mVSVersion[0m[38;2;255;255;255m%[0m[38;2;230;219;116m"[0m +[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mPATH[0m[38;2;249;38;114m=[0m[38;2;255;255;255m%[0m[38;2;255;255;255mPATH[0m[38;2;255;255;255m%[0m[38;2;230;219;116m;[0m[38;2;255;255;255m%[0m[38;2;255;255;255mLLVMPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\bin;[0m[38;2;255;255;255m%[0m[38;2;255;255;255mVSBasePath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\bin\HostX64\x64[0m[38;2;230;219;116m"[0m + +[38;2;117;113;94m::[0m[38;2;117;113;94m Compiler Flags[0m +[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;255;255;255mCFLAGS[0m[38;2;249;38;114m=[0m[38;2;230;219;116m ^[0m +[38;2;248;248;242m -std=c++[0m[38;2;190;132;255m14[0m[38;2;248;248;242m -Wall -Wextra[0m + +[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;255;255;255mCPPFLAGS[0m[38;2;249;38;114m=[0m[38;2;230;219;116m ^[0m +[38;2;248;248;242m -I [0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mVSBasePath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\include[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;190;132;255m^[0m +[38;2;248;248;242m -I [0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\Include\[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKVersion[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\shared[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;190;132;255m^[0m +[38;2;248;248;242m -I [0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\Include\[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKVersion[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\ucrt[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;190;132;255m^[0m +[38;2;248;248;242m -I [0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\Include\[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKVersion[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\um[0m[38;2;230;219;116m"[0m + + +[38;2;117;113;94m::[0m[38;2;117;113;94m Linker Libs[0m +[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;255;255;255mLDFLAGS[0m[38;2;249;38;114m=[0m[38;2;230;219;116m ^[0m +[38;2;248;248;242m -machine:x64 [0m[38;2;190;132;255m^[0m +[38;2;248;248;242m -nodefaultlib [0m[38;2;190;132;255m^[0m +[38;2;248;248;242m -subsystem:console[0m + +[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;255;255;255mLDLIBS[0m[38;2;249;38;114m=[0m[38;2;230;219;116m ^[0m +[38;2;248;248;242m -libpath:[0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mVSBasePath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\lib\x64[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;190;132;255m^[0m +[38;2;248;248;242m -libpath:[0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\Lib\[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKVersion[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\ucrt\x64[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;190;132;255m^[0m +[38;2;248;248;242m -libpath:[0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKPath[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\Lib\[0m[38;2;255;255;255m%[0m[38;2;255;255;255mWinSDKVersion[0m[38;2;255;255;255m%[0m[38;2;230;219;116m\um\x64[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;190;132;255m^[0m +[38;2;248;248;242m libucrt.lib libvcruntime.lib libcmt.lib libcpmt.lib [0m[38;2;190;132;255m^[0m +[38;2;248;248;242m legacy_stdio_definitions.lib oldnames.lib [0m[38;2;190;132;255m^[0m +[38;2;248;248;242m legacy_stdio_wide_specifiers.lib [0m[38;2;190;132;255m^[0m +[38;2;248;248;242m kernel32.lib User32.lib[0m + + +[38;2;117;113;94m::[0m[38;2;117;113;94m Compiling[0m +[38;2;249;38;114m@[0m[38;2;249;38;114mecho[0m[38;2;248;248;242m on[0m +[38;2;249;38;114m@[0m[38;2;249;38;114mfor[0m[38;2;248;248;242m [0m[38;2;190;132;255m%%[0m[38;2;248;248;242mf in [0m[38;2;248;248;242m([0m[38;2;248;248;242m*.cc[0m[38;2;248;248;242m)[0m[38;2;248;248;242m do [0m[38;2;248;248;242m([0m +[38;2;248;248;242m clang++.exe [0m[38;2;230;219;116m"[0m[38;2;190;132;255m%%[0m[38;2;230;219;116m~f[0m[38;2;230;219;116m"[0m[38;2;248;248;242m -o [0m[38;2;230;219;116m"[0m[38;2;190;132;255m%%[0m[38;2;230;219;116m~nf.o[0m[38;2;230;219;116m"[0m[38;2;248;248;242m -c [0m[38;2;255;255;255m%[0m[38;2;255;255;255mCFLAGS[0m[38;2;255;255;255m%[0m +[38;2;248;248;242m)[0m + +[38;2;117;113;94m::[0m[38;2;117;113;94m Linking[0m +[38;2;249;38;114m@[0m[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mLINK_FILES[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m +[38;2;249;38;114m@[0m[38;2;249;38;114mfor[0m[38;2;248;248;242m [0m[38;2;190;132;255m%%[0m[38;2;248;248;242mf in [0m[38;2;248;248;242m([0m[38;2;248;248;242m*.o[0m[38;2;248;248;242m)[0m[38;2;248;248;242m do [0m[38;2;248;248;242m([0m +[38;2;248;248;242m [0m[38;2;249;38;114m@[0m[38;2;249;38;114mset[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;255;255;255mLINK_FILES[0m[38;2;249;38;114m=[0m[38;2;255;255;255m%[0m[38;2;255;255;255mLINK_FILES[0m[38;2;255;255;255m%[0m[38;2;230;219;116m [0m[38;2;190;132;255m%%[0m[38;2;230;219;116m~f[0m[38;2;230;219;116m"[0m +[38;2;248;248;242m)[0m + +[38;2;248;248;242mlld-link.exe [0m[38;2;255;255;255m%[0m[38;2;255;255;255mLINK_FILES[0m[38;2;255;255;255m%[0m[38;2;248;248;242m -out:[0m[38;2;230;219;116m"[0m[38;2;255;255;255m%[0m[38;2;255;255;255mOUTPUT[0m[38;2;255;255;255m%[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;255;255;255m%[0m[38;2;255;255;255mLDFLAGS[0m[38;2;255;255;255m%[0m[38;2;248;248;242m [0m[38;2;255;255;255m%[0m[38;2;255;255;255mLDLIBS[0m[38;2;255;255;255m%[0m 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 <http://unlicense.org>
\ 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 |