2012-06-21 17:51:26 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
|
|
|
Support
|
|
|
|
)
|
|
|
|
|
|
|
|
add_llvm_unittest(SupportTests
|
2019-07-31 16:27:42 +08:00
|
|
|
AlignmentTest.cpp
|
2012-06-21 17:51:26 +08:00
|
|
|
AlignOfTest.cpp
|
|
|
|
AllocatorTest.cpp
|
[Testing] Move clangd::Annotations to llvm testing support
Summary:
Annotations allow writing nice-looking unit test code when one needs
access to locations from the source code, e.g. running code completion
at particular offsets in a file. See comments in Annotations.cpp for
more details on the API.
Also got rid of a duplicate annotations parsing code in clang's code
complete tests.
Reviewers: gribozavr, sammccall
Reviewed By: gribozavr
Subscribers: mgorny, hiraditya, ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D59814
llvm-svn: 359179
2019-04-25 18:08:31 +08:00
|
|
|
AnnotationsTest.cpp
|
2017-01-18 21:52:12 +08:00
|
|
|
ARMAttributeParser.cpp
|
2013-01-05 08:57:11 +08:00
|
|
|
ArrayRecyclerTest.cpp
|
2017-03-03 04:52:51 +08:00
|
|
|
BinaryStreamTest.cpp
|
2012-06-21 17:51:26 +08:00
|
|
|
BlockFrequencyTest.cpp
|
2014-04-30 00:12:13 +08:00
|
|
|
BranchProbabilityTest.cpp
|
2017-03-16 11:42:00 +08:00
|
|
|
CachePruningTest.cpp
|
2017-05-18 02:16:17 +08:00
|
|
|
CrashRecoveryTest.cpp
|
2012-06-21 17:51:26 +08:00
|
|
|
Casting.cpp
|
2018-03-02 08:30:43 +08:00
|
|
|
CheckedArithmeticTest.cpp
|
2016-10-20 20:05:50 +08:00
|
|
|
Chrono.cpp
|
2012-06-21 17:51:26 +08:00
|
|
|
CommandLineTest.cpp
|
2013-04-23 16:28:39 +08:00
|
|
|
CompressionTest.cpp
|
2013-07-17 01:14:33 +08:00
|
|
|
ConvertUTFTest.cpp
|
2019-04-08 20:31:12 +08:00
|
|
|
CRCTest.cpp
|
2012-06-21 17:51:26 +08:00
|
|
|
DataExtractorTest.cpp
|
2016-12-27 17:31:20 +08:00
|
|
|
DebugTest.cpp
|
2018-07-24 05:49:36 +08:00
|
|
|
DebugCounterTest.cpp
|
Resubmit r325107 (case folding DJB hash)
The issue was that the has function was generating different results depending
on the signedness of char on the host platform. This commit fixes the issue by
explicitly using an unsigned char type to prevent sign extension and
adds some extra tests.
The original commit message was:
This patch implements a variant of the DJB hash function which folds the
input according to the algorithm in the Dwarf 5 specification (Section
6.1.1.4.5), which in turn references the Unicode Standard (Section 5.18,
"Case Mappings").
To achieve this, I have added a llvm::sys::unicode::foldCharSimple
function, which performs this mapping. The implementation of this
function was generated from the CaseMatching.txt file from the Unicode
spec using a python script (which is also included in this patch). The
script tries to optimize the function by coalescing adjecant mappings
with the same shift and stride (terms I made up). Theoretically, it
could be made a bit smarter and merge adjecant blocks that were
interrupted by only one or two characters with exceptional mapping, but
this would save only a couple of branches, while it would greatly
complicate the implementation, so I deemed it was not worth it.
Since we assume that the vast majority of the input characters will be
US-ASCII, the folding hash function has a fast-path for handling these,
and only whips out the full decode+fold+encode logic if we encounter a
character outside of this range. It might be possible to implement the
folding directly on utf8 sequences, but this would also bring a lot of
complexity for the few cases where we will actually need to process
non-ascii characters.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: mgorny, hintonda, echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D42740
llvm-svn: 325732
2018-02-22 06:36:31 +08:00
|
|
|
DJBTest.cpp
|
2015-02-05 11:30:08 +08:00
|
|
|
EndianStreamTest.cpp
|
2012-06-21 17:51:26 +08:00
|
|
|
EndianTest.cpp
|
2017-06-29 21:15:31 +08:00
|
|
|
ErrnoTest.cpp
|
2013-01-21 04:32:30 +08:00
|
|
|
ErrorOrTest.cpp
|
2016-12-21 07:09:09 +08:00
|
|
|
ErrorTest.cpp
|
FileCheck [1/12]: Move variable table in new object
Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch adds a new class to hold
pattern matching global state.
The table holding the values of FileCheck variable constitutes some sort
of global state for the matching phase, yet is passed as parameters of
all functions using it. This commit create a new FileCheckPatternContext
class pointed at from FileCheckPattern. While it increases the line
count, it separates local data from global state. Later commits build
on that to add numeric expression global state to that class.
Copyright:
- Linaro (changes up to diff 183612 of revision D55940)
- GraphCore (changes in later versions of revision D55940 and
in new revision created off D55940)
Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk
Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60381
llvm-svn: 358390
2019-04-15 18:10:11 +08:00
|
|
|
FileCheckTest.cpp
|
2019-07-25 06:59:20 +08:00
|
|
|
FileCollectorTest.cpp
|
2012-08-01 10:29:50 +08:00
|
|
|
FileOutputBufferTest.cpp
|
2019-09-06 02:10:29 +08:00
|
|
|
FileUtilitiesTest.cpp
|
2016-11-12 07:57:40 +08:00
|
|
|
FormatVariadicTest.cpp
|
2016-12-21 07:09:09 +08:00
|
|
|
GlobPatternTest.cpp
|
2016-10-14 01:43:20 +08:00
|
|
|
Host.cpp
|
2018-08-25 06:31:51 +08:00
|
|
|
ItaniumManglingCanonicalizerTest.cpp
|
Lift JSON library from clang-tools-extra/clangd to llvm/Support.
Summary:
This consists of four main parts:
- an type json::Expr representing JSON values of dynamic kind, which can be
composed, inspected, and modified
- a JSON parser from string -> json::Expr
- a JSON printer from json::Expr -> string, with optional pretty-printing
- a convention for mapping json::Expr <=> native types (fromJSON/toJSON)
Mapping functions are provided for primitives (e.g. int, vector) and the
ObjectMapper helper helps implement fromJSON for struct/object types.
Based on clangd's usage, a couple of places I'd appreciate review attention:
- fromJSON returns only bool. A richer error-signaling mechanism may be useful
to provide useful messages, or let recursive fromJSONs (containers/structs)
do careful error recovery.
- should json::obj be always explicitly written (like json::ary)
- there's no streaming parse API. I suspect there are some simple wins like
a callback API where the document is a long array, and each element is small.
But this can probably be bolted on easily when we see the need.
Reviewers: bkramer, labath
Subscribers: mgorny, ilya-biryukov, ioeric, MaskRay, llvm-commits
Differential Revision: https://reviews.llvm.org/D45753
llvm-svn: 336534
2018-07-09 18:05:41 +08:00
|
|
|
JSONTest.cpp
|
2019-04-13 02:18:08 +08:00
|
|
|
KnownBitsTest.cpp
|
2014-02-22 22:00:39 +08:00
|
|
|
LEB128Test.cpp
|
2013-12-27 12:28:57 +08:00
|
|
|
LineIteratorTest.cpp
|
2013-08-07 09:22:04 +08:00
|
|
|
LockFileManagerTest.cpp
|
2019-04-25 17:03:32 +08:00
|
|
|
MatchersTest.cpp
|
2014-04-24 11:31:23 +08:00
|
|
|
MD5Test.cpp
|
2012-06-21 17:51:26 +08:00
|
|
|
ManagedStatic.cpp
|
|
|
|
MathExtrasTest.cpp
|
2012-10-05 04:29:44 +08:00
|
|
|
MemoryBufferTest.cpp
|
2012-09-20 04:46:12 +08:00
|
|
|
MemoryTest.cpp
|
2016-10-29 08:27:22 +08:00
|
|
|
NativeFormatTests.cpp
|
2017-05-11 08:03:52 +08:00
|
|
|
ParallelTest.cpp
|
2012-06-21 17:51:26 +08:00
|
|
|
Path.cpp
|
2012-12-31 19:17:50 +08:00
|
|
|
ProcessTest.cpp
|
2013-04-23 03:03:55 +08:00
|
|
|
ProgramTest.cpp
|
2012-06-21 17:51:26 +08:00
|
|
|
RegexTest.cpp
|
[ADT] Enable reverse iteration for DenseMap
Reviewers: mehdi_amini, dexonsmith, dblaikie, davide, chandlerc, davidxl, echristo, efriedma
Reviewed By: dblaikie
Subscribers: rsmith, mgorny, emaste, llvm-commits
Differential Revision: https://reviews.llvm.org/D35043
llvm-svn: 311730
2017-08-25 07:02:48 +08:00
|
|
|
ReverseIterationTest.cpp
|
2015-10-12 23:11:47 +08:00
|
|
|
ReplaceFileTest.cpp
|
2014-06-20 09:30:43 +08:00
|
|
|
ScaledNumberTest.cpp
|
2013-09-28 05:09:25 +08:00
|
|
|
SourceMgrTest.cpp
|
2014-07-10 03:40:08 +08:00
|
|
|
SpecialCaseListTest.cpp
|
2014-06-19 08:26:49 +08:00
|
|
|
StringPool.cpp
|
2012-06-21 17:51:26 +08:00
|
|
|
SwapByteOrderTest.cpp
|
2018-09-14 02:51:44 +08:00
|
|
|
SymbolRemappingReaderTest.cpp
|
2017-01-10 06:55:00 +08:00
|
|
|
TarWriterTest.cpp
|
2016-03-06 12:50:55 +08:00
|
|
|
TargetParserTest.cpp
|
2018-06-25 11:13:09 +08:00
|
|
|
TaskQueueTest.cpp
|
2013-12-20 04:32:44 +08:00
|
|
|
ThreadLocalTest.cpp
|
2015-12-15 08:59:19 +08:00
|
|
|
ThreadPool.cpp
|
2017-01-10 06:55:00 +08:00
|
|
|
Threading.cpp
|
2015-12-23 01:36:17 +08:00
|
|
|
TimerTest.cpp
|
2016-02-25 11:58:21 +08:00
|
|
|
TypeNameTest.cpp
|
2018-07-03 09:18:21 +08:00
|
|
|
TypeTraitsTest.cpp
|
2015-08-06 06:57:34 +08:00
|
|
|
TrailingObjectsTest.cpp
|
Use trigrams to speed up SpecialCaseList.
Summary:
it's often the case when the rules in the SpecialCaseList
are of the form hel.o*bar. That gives us a chance to build
trigram index to quickly discard 99% of inputs without
running a full regex. A similar idea was used in Google Code Search
as described in the blog post:
https://swtch.com/~rsc/regexp/regexp4.html
The check is defeated, if there's at least one regex
more complicated than that. In this case, all inputs
will go through the regex. That said, the real-world
rules are often simple or can be simplied. That considerably
speeds up compiling Chromium with CFI and UBSan.
As measured on Chromium's content_message_generator.cc:
before, CFI: 44 s
after, CFI: 23 s
after, CFI, no blacklist: 23 s (~1% slower, but 3 runs were unable to show the difference)
after, regular compilation to bitcode: 23 s
Reviewers: pcc
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D27188
llvm-svn: 288303
2016-12-01 10:54:54 +08:00
|
|
|
TrigramIndexTest.cpp
|
2013-09-05 00:00:12 +08:00
|
|
|
UnicodeTest.cpp
|
2018-06-11 18:28:04 +08:00
|
|
|
VersionTupleTest.cpp
|
2018-10-10 21:27:25 +08:00
|
|
|
VirtualFileSystemTest.cpp
|
2012-12-13 04:46:15 +08:00
|
|
|
YAMLIOTest.cpp
|
2012-06-21 17:51:26 +08:00
|
|
|
YAMLParserTest.cpp
|
2012-09-15 07:36:56 +08:00
|
|
|
formatted_raw_ostream_test.cpp
|
2012-09-15 07:15:56 +08:00
|
|
|
raw_ostream_test.cpp
|
2015-04-14 23:00:34 +08:00
|
|
|
raw_pwrite_stream_test.cpp
|
2016-04-01 12:30:16 +08:00
|
|
|
raw_sha1_ostream_test.cpp
|
2016-09-27 23:45:57 +08:00
|
|
|
xxhashTest.cpp
|
2012-06-21 17:51:26 +08:00
|
|
|
)
|
2014-11-08 00:08:19 +08:00
|
|
|
|
2017-12-07 18:54:23 +08:00
|
|
|
target_link_libraries(SupportTests PRIVATE LLVMTestingSupport)
|
|
|
|
|
2017-06-07 14:30:27 +08:00
|
|
|
# Disable all warning for AlignOfTest.cpp,
|
|
|
|
# as it does things intentionally, and there is no reliable way of
|
|
|
|
# disabling all warnings for all the compilers by using pragmas.
|
2019-01-28 02:41:40 +08:00
|
|
|
# Don't disable on MSVC, because all incriminated warnings are already disabled
|
|
|
|
# in source; and because we would otherwise see this warning:
|
|
|
|
# cl : Command line warning D9025: overriding '/W4' with '/w'
|
|
|
|
if(NOT MSVC)
|
|
|
|
set_source_files_properties(AlignOfTest.cpp PROPERTIES COMPILE_FLAGS -w)
|
|
|
|
endif()
|
|
|
|
if(MSVC)
|
2019-01-28 23:48:07 +08:00
|
|
|
if( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.14 )
|
2019-01-28 02:41:40 +08:00
|
|
|
# Since VS2017 15.8, the following snippet: Failed<CustomSubError>()
|
|
|
|
# generates a warning:
|
|
|
|
# \svn\llvm\utils\unittest\googlemock\include\gmock\gmock-matchers.h(186):
|
|
|
|
# warning C5046: 'testing::MatcherInterface<T>::~MatcherInterface': Symbol involving type with internal linkage not defined
|
|
|
|
set_source_files_properties(ErrorTest.cpp PROPERTIES COMPILE_FLAGS -wd5046)
|
|
|
|
endif()
|
|
|
|
endif()
|
2017-06-07 14:30:27 +08:00
|
|
|
|
2014-11-08 00:08:19 +08:00
|
|
|
# ManagedStatic.cpp uses <pthread>.
|
[CMake] Use PRIVATE in target_link_libraries for executables
We currently use target_link_libraries without an explicit scope
specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables.
Dependencies added in this way apply to both the target and its
dependencies, i.e. they become part of the executable's link interface
and are transitive.
Transitive dependencies generally don't make sense for executables,
since you wouldn't normally be linking against an executable. This also
causes issues for generating install export files when using
LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM
library dependencies, which are currently added as interface
dependencies. If clang is in the distribution components but the LLVM
libraries it depends on aren't (which is a perfectly legitimate use case
if the LLVM libraries are being built static and there are therefore no
run-time dependencies on them), CMake will complain about the LLVM
libraries not being in export set when attempting to generate the
install export file for clang. This is reasonable behavior on CMake's
part, and the right thing is for LLVM's build system to explicitly use
PRIVATE dependencies for executables.
Unfortunately, CMake doesn't allow you to mix and match the keyword and
non-keyword target_link_libraries signatures for a single target; i.e.,
if a single call to target_link_libraries for a particular target uses
one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must
also be updated to use those keywords. This means we must do this change
in a single shot. I also fully expect to have missed some instances; I
tested by enabling all the projects in the monorepo (except dragonegg),
and configuring both with and without shared libraries, on both Darwin
and Linux, but I'm planning to rely on the buildbots for other
configurations (since it should be pretty easy to fix those).
Even after this change, we still have a lot of target_link_libraries
calls that don't specify a scope keyword, mostly for shared libraries.
I'm thinking about addressing those in a follow-up, but that's a
separate change IMO.
Differential Revision: https://reviews.llvm.org/D40823
llvm-svn: 319840
2017-12-06 05:49:56 +08:00
|
|
|
target_link_libraries(SupportTests PRIVATE LLVMTestingSupport ${LLVM_PTHREAD_LIB})
|
Refactor DynamicLibrary so searching for a symbol will have a defined order and
libraries are properly unloaded when llvm_shutdown is called.
Summary:
This was mostly affecting usage of the JIT, where storing the library handles in
a set made iteration unordered/undefined. This lead to disagreement between the
JIT and native code as to what the address and implementation of particularly on
Windows with stdlib functions:
JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s
JIT: getenv("TEST") -> "VALUE" // called msvcrt.dll, getenv
Native: getenv("TEST") -> NULL // called ucrt.dll, getenv
Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows
not giving priority to the process' symbols as it did on Unix.
Reviewers: chapuni, v.g.vassilev, lhames
Reviewed By: lhames
Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits
Differential Revision: https://reviews.llvm.org/D30107
llvm-svn: 301562
2017-04-28 00:55:24 +08:00
|
|
|
|
|
|
|
add_subdirectory(DynamicLibrary)
|