Skip to content

Commit c133099

Browse files
committed
Merge branch '2019-01-25-update' into 2019-01-25-baseline
2 parents 52ca9d5 + 56a4413 commit c133099

File tree

932 files changed

+136438
-2344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

932 files changed

+136438
-2344
lines changed

.arcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"project_id" : "test-suite",
2+
"repository.callsign" : "T",
33
"conduit_uri" : "https://reviews.llvm.org/"
44
}

CMakeLists.txt

Lines changed: 97 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,24 @@ This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
5555
Please delete them.")
5656
endif()
5757

58+
# Sanity check SIZEOF_VOID_P. This is sometimes empty when compiler detection
59+
# failed, error out to avoid a mostly working but invalid setup.
60+
if(NOT CMAKE_SIZEOF_VOID_P)
61+
message(FATAL_ERROR "CMAKE_SIZEOF_VOID_P is not defined")
62+
endif()
63+
5864
# Remote configuration (will be set in lit.site.cfg)
5965
set(TEST_SUITE_REMOTE_CLIENT "ssh" CACHE STRING "Remote execution client")
6066
set(TEST_SUITE_REMOTE_HOST "" CACHE STRING "Remote execution host")
61-
set(TEST_SUITE_REMOTE_USER "" CACHE STRING "Remote execution user")
62-
set(TEST_SUITE_REMOTE_PORT "" CACHE STRING "Remote execution port")
63-
mark_as_advanced(TEST_SUITE_REMOTE_CLIENT TEST_SUITE_REMOTE_USER TEST_SUITE_REMOTE_PORT)
67+
mark_as_advanced(TEST_SUITE_REMOTE_CLIENT)
68+
69+
if(TEST_SUITE_REMOTE_HOST)
70+
add_custom_target(rsync
71+
COMMAND ${PROJECT_SOURCE_DIR}/utils/rsync.sh
72+
${TEST_SUITE_REMOTE_HOST} ${PROJECT_BINARY_DIR}
73+
USES_TERMINAL
74+
)
75+
endif()
6476

6577
# Run Under configuration for RunSafely.sh (will be set in lit.site.cfg)
6678
set(TEST_SUITE_RUN_UNDER "" CACHE STRING "RunSafely.sh run-under (-u) parameter")
@@ -70,18 +82,32 @@ set(TEST_SUITE_RUN_TYPE "train" CACHE STRING
7082
"Type of benchmark inputs (may be test,train or ref)")
7183

7284
get_filename_component(CMAKE_C_COMPILER_DIRECTORY ${CMAKE_C_COMPILER} DIRECTORY)
73-
find_program(TEST_SUITE_LLVM_SIZE NAMES "llvm-size"
74-
HINTS ${CMAKE_C_COMPILER_DIRECTORY})
75-
find_program(TEST_SUITE_LLVM_PROFDATA NAMES "llvm-profdata"
76-
HINTS ${CMAKE_C_COMPILER_DIRECTORY})
77-
mark_as_advanced(TEST_SUITE_LLVM_SIZE TEST_SUITE_LLVM_PROFDATA)
85+
86+
option(TEST_SUITE_COLLECT_CODE_SIZE "Measure code size of binaries" ON)
87+
if(TEST_SUITE_COLLECT_CODE_SIZE)
88+
find_program(TEST_SUITE_LLVM_SIZE NAMES "llvm-size"
89+
HINTS ${CMAKE_C_COMPILER_DIRECTORY})
90+
mark_as_advanced(TEST_SUITE_LLVM_SIZE)
91+
if(TEST_SUITE_LLVM_SIZE STREQUAL "TEST_SUITE_LLVM_SIZE-NOTFOUND")
92+
message(FATAL_ERROR "llvm-size not found.
93+
Make sure it is in your path or set TEST_SUITE_COLLECT_CODE_SIZE to OFF")
94+
endif()
95+
endif()
96+
7897

7998
# Enable profile generate mode in lit. Note that this does not automatically
8099
# add something like -fprofile-instr-generate to the compiler flags.
81-
set(TEST_SUITE_PROFILE_GENERATE "FALSE" CACHE BOOL
82-
"Enable lit profile generate mode")
100+
option(TEST_SUITE_PROFILE_GENERATE "Enable lit profile generate mode" OFF)
83101
# Set value to python style True/False
84102
if(TEST_SUITE_PROFILE_GENERATE)
103+
find_program(TEST_SUITE_LLVM_PROFDATA NAMES "llvm-profdata"
104+
HINTS ${CMAKE_C_COMPILER_DIRECTORY})
105+
mark_as_advanced(TEST_SUITE_LLVM_PROFDATA)
106+
if(TEST_SUITE_LLVM_PROFDATA STREQUAL "TEST_SUITE_LLVM_PROFDATA-NOTFOUND")
107+
message(FATAL_ERROR "llvm-profdata not found.
108+
Make sure it is in your path or set TEST_SUITE_PROFILE_GENERATE to OFF")
109+
endif()
110+
85111
set(TEST_SUITE_PROFILE_GENERATE "True")
86112
list(APPEND CFLAGS -fprofile-instr-generate)
87113
list(APPEND CXXFLAGS -fprofile-instr-generate)
@@ -90,8 +116,9 @@ else()
90116
set(TEST_SUITE_PROFILE_GENERATE "False")
91117
endif()
92118

93-
set(TEST_SUITE_PROFILE_USE "FALSE" CACHE BOOL
94-
"Add apropriate -fprofile-instr-use to CFLAGS/CXXFLAGS for each benchmark")
119+
option(TEST_SUITE_PROFILE_USE
120+
"Add apropriate -fprofile-instr-use to CFLAGS/CXXFLAGS for each benchmark"
121+
OFF)
95122

96123
# When running the test-suite in diagnosis mode, use these flags passed by
97124
# LNT to gather data, for examples -ftime-report, or -mllvm -stats. This way
@@ -106,6 +133,21 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TEST_SUITE_DIAGNOSE_FLAGS}")
106133
set(CMAKE_EXE_LINKER_FLAGS
107134
"${CMAKE_EXE_LINKER_FLAGS} ${TEST_SUITE_DIAGNOSE_LINKER_FLAGS}")
108135

136+
# Append extra flags. These extra flags are mainly meant for cache files that
137+
# want to apply flags that get not override even when the user manually
138+
# specifies CMAKE_C_FLAGS and similar.
139+
set(TEST_SUITE_EXTRA_C_FLAGS CACHE STRING "Extra flags for CMAKE_C_FLAGS")
140+
set(TEST_SUITE_EXTRA_CXX_FLAGS CACHE STRING "Extra flags for CMAKE_CXX_FLAGS")
141+
set(TEST_SUITE_EXTRA_EXE_LINKER_FLAGS CACHE STRING
142+
"Extra flags for CMAKE_EXE_LINKER_FLAGS")
143+
mark_as_advanced(TEST_SUITE_EXTRA_C_FLAGS, TEST_SUITE_EXTRA_CXX_FLAGS,
144+
TEST_SUITE_EXTRA_EXE_LINKER_FLAGS)
145+
set(CMAKE_C_CFLAGS "${CMAKE_C_CFLAGS} ${TEST_SUITE_EXTRA_C_FLAGS}")
146+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TEST_SUITE_EXTRA_CXX_FLAGS}")
147+
set(CMAKE_EXE_LINKER_FLAGS
148+
"${CMAKE_EXE_LINKER_FLAGS} ${TEST_SUITE_EXTRA_EXE_LINKER_FLAGS}")
149+
150+
include(TestSuite)
109151
include(SingleMultiSource)
110152
find_package(TCL)
111153

@@ -117,6 +159,10 @@ if(NOT DEFINED ARCH)
117159
include(DetectArchitecture)
118160
detect_architecture(ARCH)
119161
endif()
162+
if(NOT DEFINED X86CPU_ARCH AND ARCH STREQUAL "x86")
163+
include(DetectArchitecture)
164+
detect_x86_cpu_architecture(X86CPU_ARCH)
165+
endif()
120166
if(NOT DEFINED ENDIAN)
121167
include(TestBigEndian)
122168
test_big_endian(IS_BIGENDIAN)
@@ -129,8 +175,8 @@ endif()
129175

130176
# Disabling address space randomization makes the performance of memory/cache
131177
# intensive benchmarks more deterministic.
132-
set(TEST_SUITE_DISABLE_PIE "True" CACHE BOOL
133-
"Disable position independent executables and ASLR")
178+
option(TEST_SUITE_DISABLE_PIE
179+
"Disable position independent executables and ASLR" ON)
134180
mark_as_advanced(TEST_SUITE_DISABLE_PIE)
135181
if(TEST_SUITE_DISABLE_PIE)
136182
if(APPLE AND NOT ARCH STREQUAL "AArch64")
@@ -153,24 +199,26 @@ add_subdirectory(tools)
153199
# Shortcut for the path to the fpcmp executable
154200
set(FPCMP ${CMAKE_BINARY_DIR}/tools/fpcmp)
155201

156-
set(TEST_SUITE_TAKE_COMPILE_TIME "TRUE" CACHE BOOL
157-
"Measure compile time by wrapping compiler invocations in timeit")
158-
mark_as_advanced(TEST_SUITE_TAKE_COMPILE_TIME)
159-
if(TEST_SUITE_TAKE_COMPILE_TIME)
202+
option(TEST_SUITE_COLLECT_COMPILE_TIME
203+
"Measure compile time by wrapping compiler invocations in timeit" ON)
204+
if(TEST_SUITE_COLLECT_COMPILE_TIME)
160205
set(CMAKE_C_COMPILE_OBJECT "${CMAKE_BINARY_DIR}/tools/timeit --summary <OBJECT>.time ${CMAKE_C_COMPILE_OBJECT}")
161206
set(CMAKE_CXX_COMPILE_OBJECT "${CMAKE_BINARY_DIR}/tools/timeit --summary <OBJECT>.time ${CMAKE_CXX_COMPILE_OBJECT}")
162207
set(CMAKE_C_LINK_EXECUTABLE "${CMAKE_BINARY_DIR}/tools/timeit --summary <TARGET>.link.time ${CMAKE_C_LINK_EXECUTABLE}")
163208
set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_BINARY_DIR}/tools/timeit --summary <TARGET>.link.time ${CMAKE_CXX_LINK_EXECUTABLE}")
164209
endif()
165210

166-
set(TEST_SUITE_BENCHMARKING_ONLY "OFF" CACHE BOOL
167-
"Only run the benchmarking only subset")
211+
option(TEST_SUITE_BENCHMARKING_ONLY "Only run the benchmarking only subset" OFF)
168212

169-
set(TEST_SUITE_COLLECT_STATS "FALSE" CACHE BOOL
170-
"Collect LLVM statistics")
213+
option(TEST_SUITE_COLLECT_STATS "Collect LLVM statistics" OFF)
171214
if(TEST_SUITE_COLLECT_STATS)
172215
list(APPEND CFLAGS -save-stats=obj)
173216
list(APPEND CXXFLAGS -save-stats=obj)
217+
# Collect stats for LTO step too.
218+
if (${CMAKE_C_FLAGS} MATCHES ".*-flto.*" AND
219+
${CMAKE_CXX_FLAGS} MATCHES ".*-flto.*")
220+
list(APPEND LDFLAGS -save-stats=obj)
221+
endif()
174222
endif()
175223

176224
# Detect and include subdirectories
@@ -179,36 +227,50 @@ endif()
179227
# manually specify directories to include test-suites at external locations
180228
# and to leave out some of the default ones.
181229
if(NOT TEST_SUITE_SUBDIRS)
182-
file(GLOB sub_cmakelists */CMakeLists.txt)
230+
file(GLOB sub_cmakelists RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} */CMakeLists.txt)
183231
set(TEST_SUITE_SUBDIRS "")
184232
foreach(entry ${sub_cmakelists})
185233
get_filename_component(subdir ${entry} DIRECTORY)
186-
# Exclude tools and CTMark from default list
187-
if(NOT ${subdir} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/tools AND
188-
NOT ${subdir} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/CTMark)
234+
# Exclude tools and CTMark from default list
235+
if(NOT ${subdir} STREQUAL tools AND NOT ${subdir} STREQUAL CTMark)
189236
list(APPEND TEST_SUITE_SUBDIRS ${subdir})
190237
endif()
191238
endforeach()
192-
set(TEST_SUITE_SUBDIRS "${TEST_SUITE_SUBDIRS}" CACHE STRING
193-
"Semicolon separated list of directories with CMakeLists.txt to include")
239+
set(TEST_SUITE_SUBDIRS "${TEST_SUITE_SUBDIRS}")
194240
endif()
195-
mark_as_advanced(TEST_SUITE_SUBDIRS)
241+
set(TEST_SUITE_SUBDIRS "${TEST_SUITE_SUBDIRS}" CACHE STRING
242+
"Semicolon separated list of directories with CMakeLists.txt to include")
196243

197244
foreach(subdir ${TEST_SUITE_SUBDIRS})
245+
# When we add subdirs outside the toplevel source directory then we have to
246+
# make up a directory to use for the builddir.
247+
if(subdir MATCHES "^/" OR subdir MATCHES "\\.\\.")
248+
if(subdir MATCHES "/$")
249+
message(FATAL_ERROR "Subdir must not end in '/'")
250+
endif()
251+
get_filename_component(subdir_name ${subdir} NAME)
252+
else()
253+
set(subdir_name ${subdir})
254+
endif()
198255
message(STATUS "Adding directory ${subdir}")
199-
add_subdirectory(${subdir})
256+
add_subdirectory(${subdir} ${subdir_name})
200257
endforeach()
201258

202-
set(TEST_SUITE_RUN_BENCHMARKS "ON" CACHE BOOL
203-
"Actually run the benchmarks in lit")
259+
option(TEST_SUITE_RUN_BENCHMARKS "Actually run the benchmarks in lit" ON)
204260

205-
set(LIT_MODULES "")
261+
set(TEST_SUITE_EXTRA_LIT_MODULES "" CACHE STRING
262+
"Semicolon separated list of extra lit modules in use")
263+
mark_as_advanced(TEST_SUITE_EXTRA_LIT_MODULES)
264+
# Construct list testing modules (see also litsupport/modules/*.py)
265+
set(LIT_MODULES ${TEST_SUITE_EXTRA_LIT_MODULES})
206266
if(TEST_SUITE_RUN_BENCHMARKS)
207267
list(APPEND LIT_MODULES run)
208268
endif()
209-
list(APPEND LIT_MODULES codesize)
269+
if(TEST_SUITE_COLLECT_CODE_SIZE)
270+
list(APPEND LIT_MODULES codesize)
271+
endif()
210272
list(APPEND LIT_MODULES hash)
211-
if(TEST_SUITE_TAKE_COMPILE_TIME)
273+
if(TEST_SUITE_COLLECT_COMPILE_TIME)
212274
list(APPEND LIT_MODULES compiletime)
213275
endif()
214276
if(TEST_SUITE_RUN_UNDER)
@@ -218,9 +280,6 @@ list(APPEND LIT_MODULES timeit)
218280
if(TEST_SUITE_PROFILE_GENERATE)
219281
list(APPEND LIT_MODULES profilegen)
220282
endif()
221-
if(TEST_SUITE_REMOTE_HOST)
222-
list(APPEND LIT_MODULES remote)
223-
endif()
224283
if(TEST_SUITE_COLLECT_STATS)
225284
list(APPEND LIT_MODULES stats)
226285
endif()

CTMark/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ add_subdirectory(ClamAV)
88
add_subdirectory(sqlite3)
99
add_subdirectory(consumer-typeset)
1010
add_subdirectory(mafft)
11+
12+
file(COPY lit.local.cfg DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")

CTMark/lit.local.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
config.traditional_output = True

CompareDebugInfo.py

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/python
2+
from __future__ import print_function
23

34
import os
45
import sys
@@ -45,25 +46,24 @@ def recordArgument(self, arg_name, value):
4546
self.values[arg_name] = value
4647

4748
def __repr__(self):
48-
print self.name
49-
items = self.values.items()
50-
for i in range(len(items)):
51-
print items[i][0]," = ",items[i][1]
49+
print(self.name)
50+
for k, v in self.values.items():
51+
print(k, "=", v)
5252
return ''
5353

5454
def compare_args(self, other, file):
5555
myitems = self.values.items()
56-
otheritems = other.values.items()
56+
otheritems = list(other.values.items())
5757
match = False
58-
for i in range(len(myitems)):
58+
for i, my_item in enumerate(my_items):
5959
if i >= len(otheritems):
6060
match = True
61-
self.missing_args.append(myitems[i][0])
62-
elif cmp(myitems[i][1], otheritems[i][1]):
61+
self.missing_args.append(myitem[0])
62+
elif cmp(myitem[1], otheritems[i][1]):
6363
match = True
64-
self.notmatching_args.append(myitems[i][0])
64+
self.notmatching_args.append(myitem[0])
6565
else:
66-
self.matching_args.append(myitems[i][0])
66+
self.matching_args.append(myitem[0])
6767

6868
self.print_list(self.matching_args, " Matching arguments ", file)
6969
self.print_list(self.notmatching_args, " Not Matching arguments ", file)
@@ -108,9 +108,7 @@ def read_input(filename, dict):
108108

109109
f = open(LOG_FILE, "w")
110110
f.write("Log output\n")
111-
for f2bp in range(len(f2_items)):
112-
id = f2_items[f2bp][0]
113-
bp = f2_items[f2bp][1]
111+
for id, bp in f2_items:
114112
bp1 = f1_breakpoints.get(id)
115113
if bp1 is None:
116114
bp.setMissing()
@@ -127,9 +125,7 @@ def read_input(filename, dict):
127125
nf2_items = nf2_breakpoints.items()
128126

129127
nfl = open(NATIVE_LOG_FILE, "w")
130-
for nf2bp in range(len(nf2_items)):
131-
id = nf2_items[nf2bp][0]
132-
bp = nf2_items[nf2bp][1]
128+
for id, bp in nf2_items:
133129
bp1 = nf1_breakpoints.get(id)
134130
if bp1 is None:
135131
bp.setMissing()
@@ -141,8 +137,8 @@ def read_input(filename, dict):
141137
f1_matching_arg_count = 0
142138
f1_notmatching_arg_count = 0
143139
f1_missing_arg_count = 0
144-
for idx in range(len(f1_items)):
145-
bp = f1_items[idx][1]
140+
for f1_item in f1_items:
141+
bp = f1_item[1]
146142
f1_arg_count = f1_arg_count + bp.getArgCount()
147143
f1_matching_arg_count = f1_matching_arg_count + bp.getMatchingArgCount()
148144
f1_notmatching_arg_count = f1_notmatching_arg_count + bp.getNotMatchingArgCount()
@@ -152,8 +148,8 @@ def read_input(filename, dict):
152148
nf1_matching_arg_count = 0
153149
nf1_notmatching_arg_count = 0
154150
nf1_missing_arg_count = 0
155-
for idx in range(len(nf1_items)):
156-
bp = nf1_items[idx][1]
151+
for nf1_item in nf1_items:
152+
bp = nf1_item[1]
157153
nf1_arg_count = nf1_arg_count + bp.getArgCount()
158154
nf1_matching_arg_count = nf1_matching_arg_count + bp.getMatchingArgCount()
159155
nf1_notmatching_arg_count = nf1_notmatching_arg_count + bp.getNotMatchingArgCount()

External/CMakeLists.txt

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
1-
set(TEST_SUITE_EXTERNALS_DIR "" CACHE PATH
2-
"Directory containing test-suite external benchmark sources")
3-
4-
# Find path containing an external benchmark and set PATHVAR to it.
5-
# Specifically this:
6-
# - Adds a CACHE variable for PATHVAR
7-
# - If PATHVAR is unset set it to the first existing directory in this list:
8-
# - ${TEST_SUITE_EXTERNALS_DIR}/${NAME}
9-
# - ${CMAKE_SOURCE_DIR}/test-suite-externals/${NAME}
10-
macro(llvm_externals_find PATHVAR NAME DESCRIPTION)
11-
set(${PATHVAR} "" CACHE PATH "Directory containing ${DESCRIPTION} sourcecode")
12-
if(TEST_SUITE_EXTERNALS_DIR AND NOT ${PATHVAR} AND
13-
IS_DIRECTORY "${TEST_SUITE_EXTERNALS_DIR}/${NAME}")
14-
set(${PATHVAR} "${TEST_SUITE_EXTERNALS_DIR}/${NAME}")
15-
endif()
16-
if(NOT ${PATHVAR} AND
17-
IS_DIRECTORY "${CMAKE_SOURCE_DIR}/test-suite-externals/${NAME}")
18-
set(${PATHVAR} "${CMAKE_SOURCE_DIR}/test-suite-externals/${NAME}")
19-
endif()
20-
if(${PATHVAR})
21-
message(STATUS "Found ${DESCRIPTION}: ${${PATHVAR}}")
22-
endif()
23-
endmacro()
24-
251
add_subdirectory(CUDA)
262
add_subdirectory(HMMER)
273
add_subdirectory(Nurbs)

0 commit comments

Comments
 (0)