Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i#5365: Build core unit tests with SVE enabled #6371

Merged
merged 15 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,10 @@ if (BUILD_TESTS)
include(CTest)
endif (BUILD_TESTS)

if (AARCH64)
option(BUILD_TESTS_SVE "Build tests with SVE enabled and high optimization (-O3)" OFF)
philramsey-arm marked this conversation as resolved.
Show resolved Hide resolved
philramsey-arm marked this conversation as resolved.
Show resolved Hide resolved
endif (AARCH64)

if (BUILD_CORE)
add_subdirectory(core)
endif (BUILD_CORE)
Expand Down
18 changes: 18 additions & 0 deletions suite/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,24 @@ function(add_exe test source)
"${CMAKE_GENERATOR}" MATCHES "Visual Studio")
add_dependencies(${test} ${gen_asm_tgt})
endif ()
if (BUILD_TESTS_SVE)
target_compile_options(${test} PRIVATE
"-march=armv8.4-a+crypto+rcpc+sha3+sm4+sve+rng+ssbs+nodotprod")
philramsey-arm marked this conversation as resolved.
Show resolved Hide resolved

# Some tests give very obscure build errors when built with "-O3"
# FIXME i#5365: fix build issues due to optimisation, unless no
# optimisation is a requirement for a test case.
philramsey-arm marked this conversation as resolved.
Show resolved Hide resolved
if (
NOT ${test} STREQUAL "api.rseq" AND
NOT ${test} STREQUAL "linux.rseq" AND
NOT ${test} STREQUAL "linux.rseq_table" AND
NOT ${test} STREQUAL "linux.rseq_noarray" AND
NOT ${test} STREQUAL "linux.clone" AND
NOT ${test} STREQUAL "linux.clone-pie"
)
target_compile_options(${test} PRIVATE "-O3")
endif()
endif(BUILD_TESTS_SVE)
endfunction(add_exe)

# normal app
Expand Down
4 changes: 3 additions & 1 deletion suite/tests/client-interface/drx-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ main(int argc, char **argv)
/* child */
int iter = 0;
close(pipefd[0]); /* close unused read end */
write(pipefd[1], &buf, sizeof(buf));
if (write(pipefd[1], &buf, sizeof(buf)) == -1) {
perror("write to pipe failed\n");
}
close(pipefd[1]);
/* spin until parent kills us or we time out */
while (iter++ < 12) {
Expand Down
3 changes: 2 additions & 1 deletion suite/tests/linux/eintr.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ main(int argc, char **argv)
child_ready = false;
pthread_mutex_unlock(&lock);

write(pipefd[1], "ab", 2);
if (write(pipefd[1], "ab", 2) == -1)
perror("Failed to write to pipe\n");

if (pthread_join(thread, &retval) != 0)
perror("failed to join thread");
Expand Down
11 changes: 6 additions & 5 deletions suite/tests/linux/tool.drcov.eintr.template
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ DA:126,1
DA:127,1
DA:128,1
DA:130,1
DA:132,1
DA:133,0
DA:135,1
DA:131,0
DA:133,1
DA:134,0
DA:136,1
DA:138,1
DA:137,1
DA:139,1
DA:141,1
DA:140,1
DA:142,1
DA:143,1
end_of_record
Loading