From patchwork Wed Jun 22 14:21:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georg-Johann Lay X-Patchwork-Id: 639221 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3rZRcs6mbmz9t0X for ; Thu, 23 Jun 2016 00:22:20 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=IIFrQyzh; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=CX7Uh6xxBGfhGzZY+QJ89EVqSHY+mbwgz8kGmHdcD8F5QtKCb+ EIStw5XeE0zwfBcNnw8cR7MTWN2z2ZLDY6p2vNk0cfJVUqd2tgGhZbjflxJdZ7lb 75pexb/gf/N3uKruwSIY+cUHu4kBFRRFhRmiQ9QFtIydmw+koRq7h7D90= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=+gKesV+AAK6xRnek2/7hazynnjk=; b=IIFrQyzhKXmGFT5C8+T1 KUBgt3+L05JZndRtvL2bn82TRtJKQ4exKe5jg7joiu9HqjlmLQzvAuW7rfUOJtEo Q7SLVHJqMgJJn6OQp6K1wQl9lE9EK9ZwnGAViKF0EUNVTiymWaGxrk+IFe4rVu+3 Sk2a3Kp+iiPVfszyogtam7c= Received: (qmail 51802 invoked by alias); 22 Jun 2016 14:22:12 -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 51790 invoked by uid 89); 22 Jun 2016 14:22:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=flash, 21, 4, exceeds X-HELO: mo4-p00-ob.smtp.rzone.de Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (81.169.146.160) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 22 Jun 2016 14:22:01 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT3ol15ykJcYwTPLBCxG2PQt7BpaBF2I= X-RZG-CLASS-ID: mo00 Received: from [192.168.0.123] (ip5f5871e3.dynamic.kabel-deutschland.de [95.88.113.227]) by smtp.strato.de (RZmta 38.6 DYNA|AUTH) with ESMTPSA id 6019a7s5MELt51g (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Wed, 22 Jun 2016 16:21:55 +0200 (CEST) To: GCC Patches Cc: Mike Stump , Senthil Kumar Selvaraj , Denis Chertykov From: Georg-Johann Lay Subject: [patch, testsuite, avr]: Support dg-require-effective-target avr_3byte_pc (and use it with PR71151 tests). Message-ID: Date: Wed, 22 Jun 2016 16:21:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 X-IsSubscribed: yes Some tests for PR71151 assume that the target MCU has a 3-byte PC. The tests are failing because the simulator (avrtest) rejects to load the respective executables if .text exceeds 128KiB, e.g. for -mmcu=atmega128 which has only flash of 128KiB and only a 2-byte PC. Hence the tests have to be skipped if the target MCU has no 3-byte PC, hence a new dg-require-effective-target proc supporting "avr_3byte_pc". I added the new proc right after the last check_effective_target_arm_*** so that the test is in ASCII collating order. Ok for trunk and v6? Johann gcc/testsuite/ PR target/71151 * lib/target-supports.exp (check_effective_target_avr_3byte_pc): New proc. * gcc.target/avr/pr71151-5.c: Remove code for __AVR_2_BYTE_PC__. Use dg-require-effective-target avr_3byte_pc. * gcc.target/avr/pr71151-6.c: Same. * gcc.target/avr/pr71151-7.c: Same. * gcc.target/avr/pr71151-8.c: Same. Index: testsuite/lib/target-supports.exp =================================================================== --- testsuite/lib/target-supports.exp (revision 237587) +++ testsuite/lib/target-supports.exp (working copy) @@ -3588,6 +3588,16 @@ proc check_effective_target_arm_prefer_l } "-O2 -mthumb" ] } +# Return 1 if this is an AVR target with a 3-byte PC. + +proc check_effective_target_avr_3byte_pc { } { + return [ check_no_compiler_messages avr_3byte_pc assembly { + #if !defined(__AVR_3_BYTE_PC__) + #error !__AVR_3_BYTE_PC__ + #endif + }] +} + # Return 1 if this is a PowerPC target supporting -meabi. proc check_effective_target_powerpc_eabi_ok { } { Index: testsuite/gcc.target/avr/pr71151-5.c =================================================================== --- testsuite/gcc.target/avr/pr71151-5.c (revision 237587) +++ testsuite/gcc.target/avr/pr71151-5.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-Os -fno-tree-switch-conversion -ffunction-sections -fdata-sections -mno-relax -Wl,--section-start=.foo=0x20000" } */ +/* { dg-require-effective-target avr_3byte_pc } */ /* Make sure jumptables work properly if placed above 128 KB, i.e. 3 byte flash address for loading jump table entry and a jump table entry @@ -11,10 +12,6 @@ int main() { - /* Not meant for devices with flash <= 128K */ -#if defined (__AVR_2_BYTE_PC__) - exit(0); -#else foo(5); if (y != 37) abort(); @@ -26,5 +23,4 @@ int main() foo(7); if (y != 98) abort(); -#endif } Index: testsuite/gcc.target/avr/pr71151-6.c =================================================================== --- testsuite/gcc.target/avr/pr71151-6.c (revision 237587) +++ testsuite/gcc.target/avr/pr71151-6.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-Os -fno-tree-switch-conversion -ffunction-sections -fdata-sections -mrelax -Wl,--section-start=.foo=0x20000" } */ +/* { dg-require-effective-target avr_3byte_pc } */ /* Make sure jumptables work properly if placed above 128 KB, i.e. 3 byte flash address for loading jump table entry and a jump table entry @@ -11,10 +12,6 @@ int main() { - /* Not meant for devices with flash <= 128K */ -#if defined (__AVR_2_BYTE_PC__) - exit(0); -#else foo(5); if (y != 37) abort(); @@ -26,5 +23,4 @@ int main() foo(7); if (y != 98) abort(); -#endif } Index: testsuite/gcc.target/avr/pr71151-7.c =================================================================== --- testsuite/gcc.target/avr/pr71151-7.c (revision 237587) +++ testsuite/gcc.target/avr/pr71151-7.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-Os -fno-tree-switch-conversion -ffunction-sections -fdata-sections -mno-relax -Wl,--section-start=.foo=0x1fffa" } */ +/* { dg-require-effective-target avr_3byte_pc } */ /* Make sure jumptables work properly if placed straddling 128 KB i.e some entries below 128 KB and some above it, with relaxation disabled. */ @@ -9,10 +10,6 @@ int main() { - /* Not meant for devices with flash <= 128K */ -#if defined (__AVR_2_BYTE_PC__) - exit(0); -#else foo(5); if (y != 37) abort(); @@ -24,5 +21,4 @@ int main() foo(7); if (y != 98) abort(); -#endif } Index: testsuite/gcc.target/avr/pr71151-8.c =================================================================== --- testsuite/gcc.target/avr/pr71151-8.c (revision 237587) +++ testsuite/gcc.target/avr/pr71151-8.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-Os -fno-tree-switch-conversion -ffunction-sections -fdata-sections -mrelax -Wl,--section-start=.foo=0x1fffa" } */ +/* { dg-require-effective-target avr_3byte_pc } */ /* Make sure jumptables work properly if placed straddling 128 KB i.e some entries below 128 KB and some above it, with relaxation disabled. */ @@ -9,10 +10,6 @@ int main() { - /* Not meant for devices with flash <= 128K */ -#if defined (__AVR_2_BYTE_PC__) - exit(0); -#else foo(5); if (y != 37) abort(); @@ -24,5 +21,4 @@ int main() foo(7); if (y != 98) abort(); -#endif }