From patchwork Fri Oct 5 18:54:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edelsohn X-Patchwork-Id: 979738 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-487045-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="sSx1IJo4"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lHa5DKHE"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42Rf8075f3z9s3T for ; Sat, 6 Oct 2018 04:54:56 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:cc:content-type; q=dns; s=default; b=Oxp7ZN6p/NCihIxBeOnEj5VUgWVZwv5JsWripFATToW HNVXtSj3QkiQ1yHYGYd9NTDaDFZfYibXPZa9dx0od6wH3MophoTTgfCXz7VdO4PG nE4dhc1HSckZ7fsa99yqRHHw4kmaWyDFiL3MxANogCSsHOMXUT1H8NthHD5tw4Fg = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:cc:content-type; s=default; bh=Htm46g8hqyXwkn1qIn0ENfq16jI=; b=sSx1IJo4s7Azk0rYV TALGPNkiI4fdL2hBVzYXuTl34B4F+Z3RoGzDBFvokniFPdJyc/b26pvFEwdV5kDT 5VdcEvnzvF5Mb68npXDe2lfiVoIgnAajqIuIx6QvzAqm/39aipcaAPtoCe8Hr9GZ hbxCLYYpPZqNd1C7nKOKli+vDs= Received: (qmail 116675 invoked by alias); 5 Oct 2018 18:54:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 116594 invoked by uid 89); 5 Oct 2018 18:54:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=L1, l1 X-HELO: mail-wr1-f48.google.com Received: from mail-wr1-f48.google.com (HELO mail-wr1-f48.google.com) (209.85.221.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 05 Oct 2018 18:54:47 +0000 Received: by mail-wr1-f48.google.com with SMTP id a2-v6so7480486wrc.13 for ; Fri, 05 Oct 2018 11:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=bW2JvJMtfwPBFELe6n56cNtd1pzFtNd1Dbb5yUqmsLo=; b=lHa5DKHEripYPdFMpGYvL7Hly8dvMP26N/8RmfTbxXyKiymKZUrQjQDzuJ6SuQL4ug JIjwYuX2CWryWAWTMzOnFnGrjNsbdQN3WFa7gF2zZk4ynU4y3J1M8wpxZ7n8Z/3EPSDU rfswGcky3Lghnh8DLEwrv84Iq05aC6cIHSIS3iLrFwW3NZomoaIN9Q+Wb24Nx60xLdRg TqpXEaBOkDmywDRM6QUeHfktcJXkb9pR1TsfinWUVkLMwEktKrCxbyqg24YZ5c+7YXav NsagEHPvMEGUbA9o0fXBbxKp/iE6lZzGSGv49U7VdWEpwnOa+5K3NN2yksnS89vb+s3+ diDA== MIME-Version: 1.0 From: David Edelsohn Date: Fri, 5 Oct 2018 14:54:29 -0400 Message-ID: Subject: [PATCH, testsuite] memchr-1.c wide char and AIX To: Martin Sebor , Jeffrey Law Cc: GCC Patches memchr-1.c tests for char (test_narrow) and wchar (test_wide). The wide character test assumes 32 bit wide character, while 32 bit AIX uses 16 bit wide character. This assumption causes the wide character part of the test to fail in 32 bit mode on AIX (it succeeds on 64 bit AIX). The testcase already includes ifdefs for endianness. The "narrow" part of the test succeeds and is a useful test on AIX. Me proposed solution adds an AIX-specific ifdef in the testcase to avoid the compile-time errors in 32 bit mode. Because of the structure of the testcase, I need to #ifdef test_wide() and its constants, and separately it's invocation in main(), as opposed to making test_wide() a no-op that is called. Another alternative is to split memchr-1.c into memchr-1.c for test_narrow and memchr-2.c for test_wide, with the latter skipped on AIX using a DejaGNU directive. Is the #ifdef okay or would others prefer that I split the testcase? No solution is particularly elegant. Thanks, David * gcc.c-torture/execute/memchr-1.c (test_wide): Skip on 32 bit AIX. Index: memchr-1.c =================================================================== --- memchr-1.c (revision 264869) +++ memchr-1.c (working copy) @@ -106,6 +106,7 @@ A (memchr (&s5_3[1][i0], 0, sizeof s5_3[1] - i0) == &s5_3[1][4]); } +#if !defined(_AIX) || defined(__64BIT__) static const wchar_t wc = L'1'; static const wchar_t ws1[] = L"1"; static const wchar_t ws4[] = L"\x00123456\x12005678\x12340078\x12345600"; @@ -144,10 +145,13 @@ A (memchr (&ws4[3], 0, nb - 3 * nwb) == pws4 + 3 * nwb + 3); #endif } +#endif int main () { test_narrow (); +#if !defined(_AIX) || defined(__64BIT__) test_wide (); +#endif }