Without the patch, the output for bad-mapper-3.C would be:
/src/gcc/gcc/testsuite/g++.dg/modules/bad-mapper-3.C:2:1: error: unknown Compiled Module Interface: no such module
As this line is unexpected, the test case would fail.
The same problem can also be seen for g++.dg/modules/bad-mapper-2.C.
gcc/cp/ChangeLog:
* mapper-client.cc: Use in-process client when networking is
disabled.
gcc/testsuite/ChangeLog:
* g++.dg/modules/bad-mapper-3.C: Update dg-error pattern.
Co-Authored-By: Yvan ROUX <yvan.roux@foss.st.com>
Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
int fd = -1;
#if CODY_NETWORKING
fd = Cody::OpenLocal (&errmsg, name.c_str () + 1);
+#else
+ errmsg = "disabled";
#endif
if (fd >= 0)
c = new module_client (fd, fd);
int fd = -1;
#if CODY_NETWORKING
fd = Cody::OpenInet6 (&errmsg, name.c_str (), port);
+#else
+ errmsg = "disabled";
#endif
name[colon] = ':';
// { dg-additional-options "-fmodules-ts -fmodule-mapper=localhost:172477262" }
import unique3.bob;
-// { dg-error {failed connecting mapper 'localhost:172477262'} "" { target *-*-* } 0 }
+// { dg-error {failed (connecting|disabled) mapper 'localhost:172477262'} "" { target *-*-* } 0 }
// { dg-prune-output "fatal error:" }
// { dg-prune-output "failed to read" }
// { dg-prune-output "compilation terminated" }