From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id D9D513854569; Wed, 23 Nov 2022 13:44:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9D513854569 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669211066; bh=WE7Ymo0CzqmtVsGIHZT2+WO+LKg6uViN0I06fxz3yD8=; h=From:To:Subject:Date:From; b=H3LgMEed91Bjc+/b3ZQMhNPa+3RKFn3H6ETRgtGcVlk5FcyeKttBbbnk2EvDdHpyW esW645KJNCKNBZD7H8EnTEkP+P18XYFcrE4Jc1tnr3Ld6hKkQmVC8y6esDioHNVbcT JaSdyWEqFxmLfwVBZy67r8fCT3XEeAz1kMGouTA0= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4265] diagnostics: Fix selftest ICE in certain locales [PR107722] X-Act-Checkin: gcc X-Git-Author: Jakub Jelinek X-Git-Refname: refs/heads/master X-Git-Oldrev: 52a0ef696e1d7858fde1ded81ac8063a5768127c X-Git-Newrev: d601708870ad8dc3ef935e440bf03394891d42e2 Message-Id: <20221123134426.D9D513854569@sourceware.org> Date: Wed, 23 Nov 2022 13:44:26 +0000 (GMT) List-Id: https://gcc.gnu.org/g:d601708870ad8dc3ef935e440bf03394891d42e2 commit r13-4265-gd601708870ad8dc3ef935e440bf03394891d42e2 Author: Jakub Jelinek Date: Wed Nov 23 14:43:48 2022 +0100 diagnostics: Fix selftest ICE in certain locales [PR107722] As reported in the PR, since special_fname_builtin () call has been introduced, the diagnostics code compares filename against _("") rather than "", which means that if self tests are performed with the string being translated, one self-test fails. The following patch fixes that. 2022-11-23 Jakub Jelinek PR bootstrap/107722 * diagnostic.cc (test_diagnostic_get_location_text): Test special_fname_builtin () rather than "" and expect special_fname_builtin () concatenated with ":" for it. Diff: --- gcc/diagnostic.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc index 7c7ee6da746..a9562a815b1 100644 --- a/gcc/diagnostic.cc +++ b/gcc/diagnostic.cc @@ -2593,7 +2593,10 @@ test_diagnostic_get_location_text () const char *old_progname = progname; progname = "PROGNAME"; assert_location_text ("PROGNAME:", NULL, 0, 0, true); - assert_location_text (":", "", 42, 10, true); + char *built_in_colon = concat (special_fname_builtin (), ":", (char *) 0); + assert_location_text (built_in_colon, special_fname_builtin (), + 42, 10, true); + free (built_in_colon); assert_location_text ("foo.c:42:10:", "foo.c", 42, 10, true); assert_location_text ("foo.c:42:9:", "foo.c", 42, 10, true, 0); assert_location_text ("foo.c:42:1010:", "foo.c", 42, 10, true, 1001);