diff --git a/clients/drcachesim/tests/allasm_aarch64_flush.asm b/clients/drcachesim/tests/allasm_aarch64_flush.asm index 57b8673609c..60da62b7842 100644 --- a/clients/drcachesim/tests/allasm_aarch64_flush.asm +++ b/clients/drcachesim/tests/allasm_aarch64_flush.asm @@ -60,7 +60,7 @@ _start: ic ivau, x1 // Exit. - mov w0, #1 // stdout + mov w0, #2 // stderr #ifdef __APPLE__ adrp x1, helloworld@PAGE add x1, x1, helloworld@PAGEOFF diff --git a/clients/drcachesim/tests/allasm_aarch64_prefetch.asm b/clients/drcachesim/tests/allasm_aarch64_prefetch.asm index cd0b514ecae..09123acafdb 100644 --- a/clients/drcachesim/tests/allasm_aarch64_prefetch.asm +++ b/clients/drcachesim/tests/allasm_aarch64_prefetch.asm @@ -168,7 +168,7 @@ _start: prfum pstl3strm, [x1] // Exit. - mov w0, #1 // stdout + mov w0, #2 // stderr #ifdef __APPLE__ adrp x1, helloworld@PAGE add x1, x1, helloworld@PAGEOFF diff --git a/clients/drcachesim/tests/allasm_scattergather_aarch64.asm b/clients/drcachesim/tests/allasm_scattergather_aarch64.asm index 21d47223cbf..d7a5049dc8e 100644 --- a/clients/drcachesim/tests/allasm_scattergather_aarch64.asm +++ b/clients/drcachesim/tests/allasm_scattergather_aarch64.asm @@ -642,7 +642,7 @@ _start: // Unique instructions: 367 // Exit. - mov w0, #1 // stdout + mov w0, #2 // stderr #ifdef __APPLE__ adrp x1, helloworld@PAGE add x1, x1, helloworld@PAGEOFF diff --git a/clients/drcachesim/tests/allasm_scattergather_x86.asm b/clients/drcachesim/tests/allasm_scattergather_x86.asm index b7863eeaa4f..c6dd5651af2 100644 --- a/clients/drcachesim/tests/allasm_scattergather_x86.asm +++ b/clients/drcachesim/tests/allasm_scattergather_x86.asm @@ -229,12 +229,12 @@ incorrect_scratch: lea rsi, incorrect_scratch_str mov rdx, 18 done_cmp: - mov rdi, 1 // stdout + mov rdi, 2 // stderr mov eax, 1 // SYS_write syscall // Print end message. - mov rdi, 1 // stdout + mov rdi, 2 // stderr lea rsi, hello_str mov rdx, 13 // sizeof(hello_str) mov eax, 1 // SYS_write diff --git a/clients/drcachesim/tests/builtin_prefetch.c b/clients/drcachesim/tests/builtin_prefetch.c index 8f90980173e..9d84e8cf919 100644 --- a/clients/drcachesim/tests/builtin_prefetch.c +++ b/clients/drcachesim/tests/builtin_prefetch.c @@ -1,5 +1,5 @@ /* ********************************************************** - * Copyright (c) 2020 Google, Inc. All rights reserved. + * Copyright (c) 2020-2025 Google, Inc. All rights reserved. * **********************************************************/ /* @@ -55,6 +55,6 @@ main(void) __builtin_prefetch(&d, 1, 2); // L3 __builtin_prefetch(&d, 1, 1); - printf("Hello, world!\n"); + fprintf(stderr, "Hello, world!\n"); return 0; } diff --git a/suite/tests/CMakeLists.txt b/suite/tests/CMakeLists.txt index 21b9c32033a..ebfe4ed8743 100644 --- a/suite/tests/CMakeLists.txt +++ b/suite/tests/CMakeLists.txt @@ -3809,6 +3809,16 @@ if (BUILD_CLIENTS) "${PROJECT_SOURCE_DIR}/clients/drcachesim/tests") set(tool.drcachesim.${testname}_rawtemp ON) # no preprocessor set(tool.drcachesim.${testname}_self_serial ON) + if (UNIX) + # Avoid stale pipe files on failure causing retries to time out. + # We delete the file before and after just to be safe. + set(tool.drcachesim.${testname}_runcmp + "${CMAKE_CURRENT_SOURCE_DIR}/runmulti.cmake") + set(tool.drcachesim.${testname}_precmd + "${CMAKE_COMMAND}@-E@remove@${IPC_PREFIX}drtestpipe_${testname}") + set(tool.drcachesim.${testname}_postcmd + "${CMAKE_COMMAND}@-E@remove@${IPC_PREFIX}drtestpipe_${testname}") + endif () endmacro (torunonly_drcachesim) set(config_files_dir ${PROJECT_SOURCE_DIR}/clients/drcachesim/tests) @@ -3974,6 +3984,16 @@ if (BUILD_CLIENTS) "-ipc_name ${IPC_PREFIX}drtestpipe_${testname} ${sim_ops}" "" "${app_args}") set(tool.${testname}_toolname "drmemtrace") set(tool.${testname}_basedir "${PROJECT_SOURCE_DIR}/clients/drcachesim/tests") + if (UNIX) + # Avoid stale pipe files on failure causing retries to time out. + # We delete the file before and after just to be safe. + set(tool.${testname}_runcmp + "${CMAKE_CURRENT_SOURCE_DIR}/runmulti.cmake") + set(tool.${testname}_precmd + "${CMAKE_COMMAND}@-E@remove@${IPC_PREFIX}drtestpipe_${testname}") + set(tool.${testname}_postcmd + "${CMAKE_COMMAND}@-E@remove@${IPC_PREFIX}drtestpipe_${testname}") + endif () endmacro (torunonly_simtool) torunonly_simtool(histogram ${ci_shared_app} diff --git a/suite/tests/common/allasm_aarch64_cache.asm b/suite/tests/common/allasm_aarch64_cache.asm index c40a87354de..c3eee6eed8a 100644 --- a/suite/tests/common/allasm_aarch64_cache.asm +++ b/suite/tests/common/allasm_aarch64_cache.asm @@ -56,7 +56,7 @@ loop2: // The inner loop steps through the region writing zeroes. b.cc loop1 // Exit. - mov w0, #1 // stdout + mov w0, #2 // stderr // XXX: Use asm_defines.asm AARCH64_ADR_GOT()? #ifdef __APPLE__ adrp x1, alldone@PAGE diff --git a/suite/tests/common/allasm_arm.asm b/suite/tests/common/allasm_arm.asm index 09bb3a1a302..d184167106c 100644 --- a/suite/tests/common/allasm_arm.asm +++ b/suite/tests/common/allasm_arm.asm @@ -41,7 +41,7 @@ _start: bic sp, sp, #63 // align stack pointer to cache line mov r3, #4 1: - mov r0, #1 // stdout + mov r0, #2 // stderr ldr r1, =hello mov r2, #13 // sizeof(hello) mov r7, #4 // SYS_write @@ -119,7 +119,7 @@ separate_bb: vqshlu.s64 d3, d9, #13 // exit - mov r0, #1 // stdout + mov r0, #2 // stderr ldr r1, =alldone mov r2, #9 // sizeof(alldone) mov r7, #4 // SYS_write @@ -132,7 +132,7 @@ separate_bb: _print: mov r2, r1 // size of string mov r1, r0 // string to print - mov r0, #1 // stdout + mov r0, #2 // stderr mov r7, #4 // SYS_write svc 0 bx lr @@ -141,7 +141,7 @@ _print_pop_pc: push {r4-r8,lr} mov r2, r1 // size of string mov r1, r0 // string to print - mov r0, #1 // stdout + mov r0, #2 // stderr mov r7, #4 // SYS_write svc 0 pop {r4-r8,pc} diff --git a/suite/tests/common/allasm_thumb.asm b/suite/tests/common/allasm_thumb.asm index 64a5b8627b7..0a8bcffabdb 100644 --- a/suite/tests/common/allasm_thumb.asm +++ b/suite/tests/common/allasm_thumb.asm @@ -49,7 +49,7 @@ _start: mov r3, #4 1: - mov r0, #1 // stdout + mov r0, #2 // stderr ldr r1, =hello mov r2, #13 // sizeof(hello) mov r7, #4 // SYS_write @@ -284,7 +284,7 @@ addpc_bb: // exit _exit: - mov r0, #1 // stdout + mov r0, #2 // stderr ldr r1, =alldone mov r2, #9 // sizeof(alldone) mov r7, #4 // SYS_write @@ -297,7 +297,7 @@ _exit: _print: mov r2, r1 // size of string mov r1, r0 // string to print - mov r0, #1 // stdout + mov r0, #2 // stderr mov r7, #4 // SYS_write svc 0 bx lr @@ -306,7 +306,7 @@ _print_pop_pc: push {r4-r8,lr} mov r2, r1 // size of string mov r1, r0 // string to print - mov r0, #1 // stdout + mov r0, #2 // stderr mov r7, #4 // SYS_write svc 0 pop {r4-r8,pc} diff --git a/suite/tests/common/allasm_x86_64.asm b/suite/tests/common/allasm_x86_64.asm index 7c7d94df878..dadad691a1a 100644 --- a/suite/tests/common/allasm_x86_64.asm +++ b/suite/tests/common/allasm_x86_64.asm @@ -41,7 +41,7 @@ _start: mov rbx, 16 // loop counter loop: - mov rdi, 1 // stdout + mov rdi, 2 // stderr lea rsi, hello mov rdx, 13 // sizeof(hello) mov eax, 1 // SYS_write