From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by sourceware.org (Postfix) with ESMTPS id D5320384242B for ; Thu, 2 Jul 2020 21:08:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D5320384242B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wm1-f66.google.com with SMTP id g75so28939853wme.5 for ; Thu, 02 Jul 2020 14:08:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=N+LYXvumeMp4uXrwe4H2X/bbXLE3Es3i7WRg+zPsPE0=; b=S2+3yTOzOOmr897/JjuYindFRs62zWzUQc2aKuTCBcJqPvxa+QTO80IQKtSaHu5Rh3 yM+Jw//EXnlJGgqwy8Rfbk1AHEyPZVIEmFpTdw5kvuGgk0fXkkwEfuU2E+mqiOEKB2OA USV+Fiu3LbxM9ub6N8tzSYZ+FHjz0CdnviYuA2hcb8a1wCXckASRZuAeCr4PORUobh7a EckTy5TaWc4Fc04rg+kc12/wHAZtkakIVgYD/d++MrOeChH8nyJ+rqV6NCOmdowXhROP mcsK/WuMenxkI3o2tVgdOCeISovbnaaucYTTE2JgNFvMXMnE9s6UFhrF9DQ0d4eN6PO9 VD5w== X-Gm-Message-State: AOAM533sEC/uHH+Xk0xfY35hEuJQgDOlNieySeW0G0WipEX36zaH0PnK XewW6rN7IAr+HRgMQf9MPXMxT3l0rIL9WA== X-Google-Smtp-Source: ABdhPJzHJuQliU0ygeelgAnF01//+27PPZ7CdR5lAJQNLZPmZyrfmDJmzMXGNZuxiPmmde0QBXYIUw== X-Received: by 2002:a1c:4086:: with SMTP id n128mr34592087wma.118.1593724093518; Thu, 02 Jul 2020 14:08:13 -0700 (PDT) Received: from ?IPv6:2001:8a0:f922:c400:56ee:75ff:fe8d:232b? ([2001:8a0:f922:c400:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id r10sm11874857wrm.17.2020.07.02.14.08.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jul 2020 14:08:12 -0700 (PDT) Subject: Re: [PATCH] Skip tests requiring "alignof (void)" when compiling using clang To: Simon Marchi , Gary Benson , gdb-patches@sourceware.org References: <1593529380-8689-1-git-send-email-gbenson@redhat.com> <8361fbe3-9843-95c1-6451-7a1a2aa0463e@simark.ca> From: Pedro Alves Message-ID: <905a7685-ecdd-cbdf-072f-c809efbccc76@palves.net> Date: Thu, 2 Jul 2020 22:08:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <8361fbe3-9843-95c1-6451-7a1a2aa0463e@simark.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2020 21:08:16 -0000 On 7/2/20 9:52 PM, Simon Marchi wrote: > On 2020-07-02 4:49 p.m., Pedro Alves wrote: >> I think this should still test GDB's support. And a >> comment would be helpful. Like: >> >> # As an extension, GCC allows void pointer arithmetic, with >> # sizeof(void) and alignof(void) both 1. GDB supports GCC's >> # extension. Clang does not. >> if ![test_compiler_info clang*] { >> set expected [get_integer_valueof a_void 0] >> gdb_test "print alignof(void)" " = $expected" >> } else { >> gdb_test "print alignof(void)" " = 1" >> } > > Indeed. Otherwise, let's say that clang gain this feature, it would remain untested > (when testing with clang) and nobody would think of coming here to update the test > case. Here, if clang gains the feature, then I suppose it would generate a FAIL, > which would prompt us to update the test case. Actually, if Clang gains the feature, the test would still pass. GDB's alignof support is builtin, does not depend on what the compiler outputs.