Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 7fd62f4

Browse files
authored
Merge pull request #28 from llvm/master
Pull down llvm/llvm-test-suite changes
2 parents 48dfdf2 + 83e8ccb commit 7fd62f4

File tree

6 files changed

+58
-9
lines changed

6 files changed

+58
-9
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ include(CheckSymbolExists)
44

55
project(test-suite C CXX)
66

7+
function(append value)
8+
foreach(variable ${ARGN})
9+
set(${variable} "${${variable}} ${value}" PARENT_SCOPE)
10+
endforeach(variable)
11+
endfunction()
12+
713
# The test-suite is designed to be built in release mode anyway and
814
# falls over unless -DNDEBUG is set.
915
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
@@ -156,6 +162,11 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TEST_SUITE_DIAGNOSE_FLAGS}")
156162
set(CMAKE_EXE_LINKER_FLAGS
157163
"${CMAKE_EXE_LINKER_FLAGS} ${TEST_SUITE_DIAGNOSE_LINKER_FLAGS}")
158164

165+
if (TESTSUITE_USE_LINKER)
166+
append("-fuse-ld=${TESTSUITE_USE_LINKER}"
167+
CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAG)
168+
endif()
169+
159170
# Append extra flags. These extra flags are mainly meant for cache files that
160171
# want to apply flags that get not override even when the user manually
161172
# specifies CMAKE_C_FLAGS and similar.

External/CUDA/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ macro(create_local_cuda_tests VariantSuffix)
9898
create_one_local_test(empty empty.cu)
9999
create_one_local_test(printf printf.cu)
100100
create_one_local_test(future future.cu)
101+
create_one_local_test(builtin_var builtin_var.cu)
101102
# We only need SIMD tests on CUDA-8.0 to verivy that our reference is correct
102103
# and matches NVIDIA-provided one. and on CUDA-9.2 to verify that clang's
103104
# implementation matches the reference. This test also happens to be the

External/CUDA/builtin_var.cu

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
__global__ void kernel() {
2+
// Verify that *Idx/*Dim can be assigned to uint3/dim3.
3+
uint3 thread_idx = threadIdx;
4+
uint3 block_idx = blockIdx;
5+
dim3 block_dim = blockDim;
6+
dim3 grid_dim = gridDim;
7+
8+
// And that they can be converted to uint3/dim3
9+
dim3 thread_idx_dim = threadIdx;
10+
dim3 block_idx_dim = blockIdx;
11+
uint3 block_dim_uint = blockDim;
12+
uint3 grid_dim_uint = gridDim;
13+
}
14+
15+
int main(int argc, char* argv[]) {
16+
kernel<<<2, 2>>>();
17+
cudaDeviceSynchronize();
18+
cudaDeviceReset();
19+
return 0;
20+
}

SingleSource/UnitTests/Vector/AArch64/aarch64_neon_intrinsics.reference_output

Lines changed: 0 additions & 3 deletions
This file was deleted.

litsupport/modules/timeit.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ def getUserTime(filename):
9494

9595

9696
def getUserTimeFromContents(contents):
97-
line = [line for line in contents.splitlines() if line.startswith('user')]
97+
from_bytes = lambda s: s.decode("utf-8") if type(s) == bytes else s
98+
lines = [from_bytes(l) for l in contents.splitlines()]
99+
line = [line for line in lines if line.startswith('user')]
98100
assert len(line) == 1
99101

100102
m = re.match(r'user\s+([0-9.]+)', line[0])

utils/compare.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,14 @@ def format_diff(value):
207207
else:
208208
return "%-5d" % value
209209

210-
def print_result(d, limit_output=True, shorten_names=True,
211-
show_diff_column=True, sortkey='diff'):
210+
def print_result(d, limit_output=True, shorten_names=True, minimal_names=False,
211+
show_diff_column=True, sortkey='diff', sort_by_abs=True):
212212
# sort (TODO: is there a more elegant way than create+drop a column?)
213-
d['$sortkey'] = d[sortkey].abs()
213+
if sort_by_abs:
214+
d['$sortkey'] = d[sortkey].abs()
215+
else:
216+
d['$sortkey'] = d[sortkey]
217+
214218
d = d.sort_values("$sortkey", ascending=False)
215219
del d['$sortkey']
216220
if not show_diff_column:
@@ -236,7 +240,17 @@ def format_name(name, common_prefix, common_suffix):
236240
name = name[:-common_suffix]
237241
return "%-45s" % truncate(name, 10, 30)
238242

239-
formatters['Program'] = lambda name: format_name(name, drop_prefix, drop_suffix)
243+
244+
def strip_name_fully(name):
245+
name = name.split('/')[-1]
246+
if name.endswith('.test'):
247+
name = name[:-5]
248+
return name
249+
250+
if minimal_names:
251+
formatters['Program'] = strip_name_fully
252+
else:
253+
formatters['Program'] = lambda name: format_name(name, drop_prefix, drop_suffix)
240254
def float_format(x):
241255
if x == '':
242256
return ''
@@ -277,6 +291,10 @@ def float_format(x):
277291
parser.add_argument('--rhs-name', default="rhs",
278292
help="Name used to describe right side in 'vs' mode")
279293
parser.add_argument('files', metavar='FILE', nargs='+', help="To compare two groups of results, put 'vs' between them")
294+
parser.add_argument('--minimal-names', action='store_true',
295+
dest='minimal_names', default=False)
296+
parser.add_argument('--no-abs-sort', action='store_true',
297+
dest='no_abs_sort', default=False, help="Don't use abs() when sorting results")
280298
config = parser.parse_args()
281299

282300
if config.show_diff is None:
@@ -371,4 +389,4 @@ def float_format(x):
371389
print("")
372390
shorten_names = not config.full
373391
limit_output = (not config.all) and (not config.full)
374-
print_result(data, limit_output, shorten_names, config.show_diff, sortkey)
392+
print_result(data, limit_output, shorten_names, config.minimal_names, config.show_diff, sortkey, config.no_abs_sort)

0 commit comments

Comments
 (0)