Skip to content

Commit 771873f

Browse files
committed
testsuite, jit: fix test-error-pr63969-missing-driver.c
jit.dg/test-error-pr63969-missing-driver.c tries to break PATH and verify that an error is generated when using an external driver. However it does this by unsetting PATH, and so the test could accidentally find the driver if the system supplies a default and the driver happens to be installed in that path (reported as rhbz#2318021). Fix the test by instead setting PATH to a bogus value. gcc/testsuite/ChangeLog: * jit.dg/test-error-pr63969-missing-driver.c (create_code): When breaking PATH, use setenv with a bogus value, rather than unsetenv, in case the system uses a default path that contains the driver binary. Signed-off-by: David Malcolm <[email protected]> (cherry picked from commit f8dcb55) Signed-off-by: David Malcolm <[email protected]>
1 parent 434483a commit 771873f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gcc/testsuite/jit.dg/test-error-pr63969-missing-driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ create_code (gcc_jit_context *ctxt, void *user_data)
2828
/* Break PATH, so that the driver can't be found
2929
by gcc::jit::playback::context::compile ()
3030
within gcc_jit_context_compile. */
31-
unsetenv ("PATH");
31+
setenv ("PATH", "/this/is/not/a/valid/path", 1);
3232
}
3333

3434
void

0 commit comments

Comments
 (0)