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

Commit 32f59c2

Browse files
[SYCL] Prevent skipped GPU run from overwriting CPU output in DeviceLib/assert.cpp (#1228)
Though the two potential runs in DeviceLib/assert.cpp are mutually exclusive, skipping the latter run (GPU) will still trigger a write to the output file, overwriting the results from the previous (CPU) run. To avoid this, these changes first ensures the output file is cleared then makes the runs append their output to the file. Since the runs are mutually exclusive the file should at most contain the output of one expected run. Signed-off-by: Larsen, Steffen <[email protected]>
1 parent e4add67 commit 32f59c2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

SYCL/DeviceLib/assert.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,12 @@
7171
//
7272
// Overall this sounds stable enough. What could possibly go wrong?
7373
//
74-
// RUN: %CPU_RUN_PLACEHOLDER env SYCL_PI_TRACE=2 SHOULD_CRASH=1 EXPECTED_SIGNAL=SIGABRT %t.out 2>%t.stderr.native
75-
// RUN: %GPU_RUN_PLACEHOLDER env SHOULD_CRASH=1 EXPECTED_SIGNAL=SIGIOT %t.out 2>%t.stderr.native
74+
// With either a CPU run or a GPU run we reset the output file and append the
75+
// results of the runs. Otherwise a skipped GPU run may remove the output from
76+
// a CPU run prior to running FileCheck.
77+
// RUN: echo "" > %t.stderr.native
78+
// RUN: %CPU_RUN_PLACEHOLDER SYCL_PI_TRACE=2 SHOULD_CRASH=1 EXPECTED_SIGNAL=SIGABRT %t.out 2>> %t.stderr.native
79+
// RUN: %GPU_RUN_PLACEHOLDER SHOULD_CRASH=1 EXPECTED_SIGNAL=SIGIOT %t.out 2>> %t.stderr.native
7680
// RUN: FileCheck %s --input-file %t.stderr.native --check-prefixes=CHECK-MESSAGE || FileCheck %s --input-file %t.stderr.native --check-prefix CHECK-NOTSUPPORTED
7781
//
7882
// Skip the test if the CPU RT doesn't support the extension yet:

0 commit comments

Comments
 (0)