From patchwork Thu Sep 4 20:28:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 2651 Received: (qmail 13963 invoked by alias); 4 Sep 2014 20:28:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 13945 invoked by uid 89); 4 Sep 2014 20:28:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ie0-f201.google.com Received: from mail-ie0-f201.google.com (HELO mail-ie0-f201.google.com) (209.85.223.201) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 04 Sep 2014 20:28:21 +0000 Received: by mail-ie0-f201.google.com with SMTP id tr6so1860095ieb.0 for ; Thu, 04 Sep 2014 13:28:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:cc:date:message-id:mime-version :content-type; bh=dQcianOxZkQmPXm/H5wWte8fUGiJ7rTG4ay9DFRULWU=; b=NAGsnZac3ESHpmPDrLS+a25nNPi72+b4rKJ65NNvBxcIt2lmNaArtv5g+XZ4dctjT/ 5hRG8EBmd+nI4sThGqQhstI08qrdoSbFXVdQO7pVJd/7sfY/zRogudpADL3MjhiwWJRU uvLN+z/OjITLlAKgWaj5UHlOAlp3lQxMD0D2RaqXYsZsrJbjhaxrcK6yfdl6KZvQDazP /mKIYRNRseEo3YNDXcBewT3NAjdcNQZe+oTokMF8ApLldFd3xMiQ0pgSP2qHAPb5ROPg I1KZsJuZOx9jcrJB/TZWC1hXy/RESIUbdLb/27KDe8Roht0QxzwLL0zm8mhA6e8INPXR m/1A== X-Gm-Message-State: ALoCoQlJRLAvjKsU2LqEn79DhHIkwV9QfOz+6rvmiOn3tc+JUXVZAD3qRBNt3JVrX/XgGMqy7iCI X-Received: by 10.42.58.138 with SMTP id i10mr4011480ich.18.1409862498669; Thu, 04 Sep 2014 13:28:18 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id n22si9633yhd.1.2014.09.04.13.28.18 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Sep 2014 13:28:18 -0700 (PDT) Received: from ruffy.mtv.corp.google.com (ruffy.mtv.corp.google.com [172.17.128.44]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTPS id 522BA31C356; Thu, 4 Sep 2014 13:28:18 -0700 (PDT) From: Doug Evans To: gdb-patches@sourceware.org Subject: [PATCH] Misc. testsuite cleanups for clang. cc: dblaikie@gmail.com Date: Thu, 04 Sep 2014 13:28:17 -0700 Message-ID: MIME-Version: 1.0 X-IsSubscribed: yes Hi. These tests fail with clang due to compilation errors. I've studied these tests and believe the changes don't influence the intent of the test. Regression tested on amd64-linux with gcc and clang. 2014-09-04 Doug Evans Misc. testsuite cleanups for clang. * gdb.base/call-sc.c (zed): Specify result is void. * gdb.base/savedreges (caller): Add parentheses to expression. (thrower): Add volatile to *(char *)0. (main): Add int result type. * gdb.base/structs.c (zed): Specify result is void. diff --git a/gdb/testsuite/gdb.base/call-sc.c b/gdb/testsuite/gdb.base/call-sc.c index cec4b34..b9260b9 100644 --- a/gdb/testsuite/gdb.base/call-sc.c +++ b/gdb/testsuite/gdb.base/call-sc.c @@ -51,7 +51,7 @@ void Fun(foo) L = foo; } -zed () +void zed () { L = 'Z'; } diff --git a/gdb/testsuite/gdb.base/savedregs.c b/gdb/testsuite/gdb.base/savedregs.c index b886787..23c764e 100644 --- a/gdb/testsuite/gdb.base/savedregs.c +++ b/gdb/testsuite/gdb.base/savedregs.c @@ -33,7 +33,8 @@ callee (int param) extern int caller (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { - return callee (a1 << a2 * a3 / a4 + a6 & a6 % a7 - a8) + done; + /* Note: The extra parentheses are to silence clang warnings. */ + return callee (a1 << (a2 * a3 / a4 + a6) & a6 % a7 - a8) + done; } static void @@ -45,8 +46,9 @@ catcher (int sig) static void thrower (void) { - /* Trigger a SIGSEGV. */ - *(char *)0 = 0; + /* Trigger a SIGSEGV. + A volatile pointer is used to silence a clang warning. */ + *(volatile char *)0 = 0; /* On MMU-less system, previous memory access to address zero doesn't trigger a SIGSEGV. Trigger a SIGILL. Each arch should define its @@ -61,7 +63,7 @@ thrower (void) } -main () +int main () { signal (SIGILL, catcher); signal (SIGSEGV, catcher); diff --git a/gdb/testsuite/gdb.base/structs.c b/gdb/testsuite/gdb.base/structs.c index 60772bb..9ff0b35 100644 --- a/gdb/testsuite/gdb.base/structs.c +++ b/gdb/testsuite/gdb.base/structs.c @@ -356,7 +356,7 @@ void Fun18(foo18) L18 = foo18; } -zed () +void zed () { L1.a = L2.a = L3.a = L4.a = L5.a = L6.a = L7.a = L8.a = L9.a = L10.a = L11.a = L12.a = L13.a = L14.a = L15.a = L16.a = L17.a = L18.a = 'Z';