From patchwork Wed Jul 24 16:23:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chung-Ju Wu X-Patchwork-Id: 261454 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id D8CA62C00C1 for ; Thu, 25 Jul 2013 02:23:39 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=GPuOi3btrkgKMaoQH ZwoCAF9HdjRhebe6uCXbiIN9iNjl1ukHdRzPT/d930Icms/cV8I/jW8bPw7LIlhJ F4YejW+xfjX5PWJYE8wQRvTOZDfJa3CBkiXMMq7JilLTv/v7diM8kx/AQtL9IWum bZjnCsd8abHdwESZLQ5T94kB/s= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=pbPXQJ4bftsV5dZGFnxoP/h Wmrw=; b=e7Z6KppDgPtUi3SPFl5GoMrIIv7n9NprPxoA1RS9rMHymol0bN97InE jq7bGATZECy8XZxvwBY6uEDgxG6Wf8QoFUsIbHRNmMQI5F3NMsgMVAd7wrU9NWxf 5rG1aJGOHxVkjpYn/aIBLvcE+86HxpeEO7jCoJQCBxUlXYz6YiVE= Received: (qmail 31992 invoked by alias); 24 Jul 2013 16:23:31 -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 31978 invoked by uid 89); 24 Jul 2013 16:23:31 -0000 X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RDNS_NONE, SPF_PASS, TW_EG, TW_UC autolearn=no version=3.3.1 Received: from Unknown (HELO mail-pb0-f48.google.com) (209.85.160.48) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 24 Jul 2013 16:23:29 +0000 Received: by mail-pb0-f48.google.com with SMTP id md4so2009235pbc.21 for ; Wed, 24 Jul 2013 09:23:21 -0700 (PDT) X-Received: by 10.68.254.138 with SMTP id ai10mr8760066pbd.151.1374683001752; Wed, 24 Jul 2013 09:23:21 -0700 (PDT) Received: from Wu-Chung-Jude-MacBook-Air.local (123-194-206-10.dynamic.kbronet.com.tw. [123.194.206.10]) by mx.google.com with ESMTPSA id py4sm48789459pbc.14.2013.07.24.09.23.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Jul 2013 09:23:21 -0700 (PDT) Message-ID: <51EFFF73.3030700@gmail.com> Date: Thu, 25 Jul 2013 00:23:15 +0800 From: Chung-Ju Wu User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-Version: 1.0 To: "Joseph S. Myers" CC: gcc-patches Subject: Re: [PATCH 4/6] Andes nds32: testsuite modifications for nds32 target. References: In-Reply-To: X-Virus-Found: No Hi, Joseph, Sorry for the late revised patch. We have completed all of it based on your review comments. On 7/10/13 8:08 AM, Joseph S. Myers wrote: > On Mon, 8 Jul 2013, Chung-Ju Wu wrote: > >> * gcc.dg/ucnid-11.c: Skip for nds32*-*-*. >> * gcc.dg/ucnid-2.c: Skip for nds32*-*-*. >> * gcc.dg/ucnid-3.c: Skip for nds32*-*-*. > > Skipping these tests seems dubious - you should fix the assembler bug that > it fails to support extended identifiers instead of skipping the tests. > We have cooperated with toolchain engineers. These three cases now are able to tested for nds32 target. > I don't see any sign of new architecture-specific testcases. It's > generally a good idea to have such tests, to verify that built-in > functions and attributes and options work as expected, that the > diagnostics in the back end are given for the invalid input you expect to > give such diagnostics, etc. (Of course the gcc.target/nds32 testsuite > will grow over time with testcases for bugs in such architecture-specific > functionality that get found and fixed over time.) > Thanks for the comments. We added several new target-specific testcases under gcc.target/nds32, including basic main execution and built-in functions verification. A revised patch is provided and here is a summary: 1. The extend identifiers testcases are supposed to be tested. 2. Add preliminary nds32-specific testcases. gcc/testsuite/ 2013-07-24 Chung-Ju Wu Shiva Chen * g++.dg/other/PR23205.C: Skip for nds32*-*-*. * g++.dg/other/pr23205-2.C: Skip for nds32*-*-*. * gcc.dg/20020312-2.c: Add __nds32__ case. * gcc.dg/builtin-apply2.c: Skip for nds32*-*-*. * gcc.dg/lower-subreg-1.c: Skip for nds32*-*-*. * gcc.dg/sibcall-3.c: Expected fail for nds32*-*-*. * gcc.dg/sibcall-4.c: Expected fail for nds32*-*-*. * gcc.dg/stack-usage-1.c (SIZE): Define case for __nds32__. * gcc.dg/torture/pr37868.c: Skip for nds32*-*-*. * gcc.dg/torture/stackalign/builtin-apply-2.c: Skip for nds32*-*-*. * gcc.dg/tree-ssa/20040204-1.c: Expected fail for nds32*-*-*. * gcc.dg/tree-ssa/forwprop-28.c: Skip for nds32*-*-*. * gcc.dg/tree-ssa/pr42585.c: Skip for nds32*-*-*. * gcc.dg/tree-ssa/sra-12.c: Skip for nds32*-*-*. * gcc.target/nds32: New nds32 specific directory and testcases. * lib/target-supports.exp (check_profiling_available): Check for nds32*-*-elf. Best regards, jasonwucj diff --git gcc/testsuite/g++.dg/other/PR23205.C gcc/testsuite/g++.dg/other/PR23205.C index e55710b..26a9dd5 100644 --- gcc/testsuite/g++.dg/other/PR23205.C +++ gcc/testsuite/g++.dg/other/PR23205.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* *-*-vxworks } { "*" } { "" } } */ +/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* nds32*-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* *-*-vxworks } { "*" } { "" } } */ /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types" } */ const int foobar = 4; diff --git gcc/testsuite/g++.dg/other/pr23205-2.C gcc/testsuite/g++.dg/other/pr23205-2.C index 607e5a2..b25cb73 100644 --- gcc/testsuite/g++.dg/other/pr23205-2.C +++ gcc/testsuite/g++.dg/other/pr23205-2.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* } { "*" } { "" } } */ +/* { dg-skip-if "No stabs" { aarch64*-*-* mmix-*-* nds32*-*-* *-*-aix* alpha*-*-* hppa*64*-*-* ia64-*-* tile*-*-* } { "*" } { "" } } */ /* { dg-options "-gstabs+ -fno-eliminate-unused-debug-types -ftoplevel-reorder" } */ const int foobar = 4; diff --git gcc/testsuite/gcc.dg/20020312-2.c gcc/testsuite/gcc.dg/20020312-2.c index 633da5b..6f5a953 100644 --- gcc/testsuite/gcc.dg/20020312-2.c +++ gcc/testsuite/gcc.dg/20020312-2.c @@ -52,6 +52,8 @@ extern void abort (void); /* No pic register. */ #elif defined(__moxie__) /* No pic register. */ +#elif defined(__nds32__) +/* No pic register. */ #elif defined(__hppa__) /* PIC register is %r27 or %r19, but is used even without -fpic. */ #elif defined(__pdp11__) diff --git gcc/testsuite/gcc.dg/builtin-apply2.c gcc/testsuite/gcc.dg/builtin-apply2.c index 9b73147..7bf3049 100644 --- gcc/testsuite/gcc.dg/builtin-apply2.c +++ gcc/testsuite/gcc.dg/builtin-apply2.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { "aarch64*-*-* avr-*-* " } { "*" } { "" } } */ +/* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { "aarch64*-*-* avr-*-* nds32*-*-*" } { "*" } { "" } } */ /* { dg-skip-if "Variadic funcs use Base AAPCS. Normal funcs use VFP variant." { "arm*-*-*" } { "-mfloat-abi=hard" } { "" } } */ /* PR target/12503 */ diff --git gcc/testsuite/gcc.dg/lower-subreg-1.c gcc/testsuite/gcc.dg/lower-subreg-1.c index f5827e1..f299ea4 100644 --- gcc/testsuite/gcc.dg/lower-subreg-1.c +++ gcc/testsuite/gcc.dg/lower-subreg-1.c @@ -1,6 +1,7 @@ /* { dg-do compile { target { ! { mips64 || { arm*-*-* ia64-*-* sparc*-*-* spu-*-* tilegx-*-* } } } } } */ /* { dg-options "-O -fdump-rtl-subreg1" } */ /* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && x32 } { "*" } { "" } } */ +/* { dg-skip-if "nds32 target has special operations for 64-bit behavior" { nds32*-*-* } { "*" } { "" } } */ /* { dg-require-effective-target ilp32 } */ long long test (long long a, long long b) { return a | b; } diff --git gcc/testsuite/gcc.dg/sibcall-3.c gcc/testsuite/gcc.dg/sibcall-3.c index c4460e2..e02a410 100644 --- gcc/testsuite/gcc.dg/sibcall-3.c +++ gcc/testsuite/gcc.dg/sibcall-3.c @@ -5,7 +5,7 @@ Copyright (C) 2002 Free Software Foundation Inc. Contributed by Hans-Peter Nilsson */ -/* { dg-do run { xfail { { cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */ +/* { dg-do run { xfail { { cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* nds32*-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */ /* -mlongcall disables sibcall patterns. */ /* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */ /* { dg-options "-O2 -foptimize-sibling-calls" } */ diff --git gcc/testsuite/gcc.dg/sibcall-4.c gcc/testsuite/gcc.dg/sibcall-4.c index 4f468f6..a66ed07 100644 --- gcc/testsuite/gcc.dg/sibcall-4.c +++ gcc/testsuite/gcc.dg/sibcall-4.c @@ -5,7 +5,7 @@ Copyright (C) 2002 Free Software Foundation Inc. Contributed by Hans-Peter Nilsson */ -/* { dg-do run { xfail { { cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */ +/* { dg-do run { xfail { { cris-*-* crisv32-*-* h8300-*-* hppa*64*-*-* m32r-*-* mcore-*-* mn10300-*-* nds32*-*-* xstormy16-*-* v850*-*-* vax-*-* xtensa*-*-* } || { arm*-*-* && { ! arm32 } } } } } */ /* -mlongcall disables sibcall patterns. */ /* { dg-skip-if "" { powerpc*-*-* } { "-mlongcall" } { "" } } */ /* { dg-options "-O2 -foptimize-sibling-calls" } */ diff --git gcc/testsuite/gcc.dg/stack-usage-1.c gcc/testsuite/gcc.dg/stack-usage-1.c index fa299c4..0ce9a8a 100644 --- gcc/testsuite/gcc.dg/stack-usage-1.c +++ gcc/testsuite/gcc.dg/stack-usage-1.c @@ -36,6 +36,9 @@ # else # define SIZE 248 # endif +#elif defined (__nds32__) +# define SIZE 248 /* 256 - 8 bytes, only $fp and padding bytes are saved in + the register save area under O0 optimization level. */ #elif defined (__powerpc64__) || defined (__ppc64__) || defined (__POWERPC64__) \ || defined (__PPC64__) # define SIZE 180 diff --git gcc/testsuite/gcc.dg/torture/pr37868.c gcc/testsuite/gcc.dg/torture/pr37868.c index c1b7a2b..54fbdda 100644 --- gcc/testsuite/gcc.dg/torture/pr37868.c +++ gcc/testsuite/gcc.dg/torture/pr37868.c @@ -1,6 +1,7 @@ /* { dg-do run } */ /* { dg-options "-fno-strict-aliasing" } */ /* { dg-skip-if "unaligned access" { sparc*-*-* sh*-*-* tic6x-*-* } "*" "" } */ +/* { dg-skip-if "unaligned access" { nds32*-*-* } "*" "" } */ extern void abort (void); #if (__SIZEOF_INT__ <= 2) diff --git gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c index 7982210..c282bb8 100644 --- gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c +++ gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c @@ -7,6 +7,7 @@ /* { dg-do run } */ /* { dg-skip-if "Variadic funcs use Base AAPCS. Normal funcs use VFP variant." { arm_hf_eabi } } */ +/* { dg-skip-if "Variadic funcs arguments will push by caller for current nds32 porting." { nds32*-*-* } } */ #define INTEGER_ARG 5 diff --git gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c index 470b585..8518dfb 100644 --- gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c +++ gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c @@ -33,5 +33,5 @@ void test55 (int x, int y) that the && should be emitted (based on BRANCH_COST). Fix this by teaching dom to look through && and register all components as true. */ -/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* arm*-*-* powerpc*-*-* cris-*-* crisv32-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* sparc*-*-* spu-*-* x86_64-*-*" } } } } */ +/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" { xfail { ! "alpha*-*-* arm*-*-* powerpc*-*-* cris-*-* crisv32-*-* hppa*-*-* i?86-*-* mmix-*-* mips*-*-* m68k*-*-* moxie-*-* nds32*-*-* sparc*-*-* spu-*-* x86_64-*-*" } } } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c index a64987b..d6b03a3 100644 --- gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c +++ gcc/testsuite/gcc.dg/tree-ssa/forwprop-28.c @@ -1,4 +1,4 @@ -/* { dg-do compile { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-*"} } } */ +/* { dg-do compile { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* nds32*-*-* powerpc*-*-* xtensa*-*-*"} } } */ /* { dg-options "-O2 -fdump-tree-forwprop1" } */ extern char *frob (void); diff --git gcc/testsuite/gcc.dg/tree-ssa/pr42585.c gcc/testsuite/gcc.dg/tree-ssa/pr42585.c index f3d8459..fae828c 100644 --- gcc/testsuite/gcc.dg/tree-ssa/pr42585.c +++ gcc/testsuite/gcc.dg/tree-ssa/pr42585.c @@ -35,6 +35,6 @@ Cyc_string_ungetc (int ignore, struct _fat_ptr *sptr) /* Whether the structs are totally scalarized or not depends on the MOVE_RATIO macro definition in the back end. The scalarization will not take place when using small values for MOVE_RATIO. */ -/* { dg-final { scan-tree-dump-times "struct _fat_ptr _ans" 0 "optimized" { target { ! "arm*-*-* powerpc*-*-* s390*-*-* sh*-*-*" } } } } */ -/* { dg-final { scan-tree-dump-times "struct _fat_ptr _T2" 0 "optimized" { target { ! "arm*-*-* powerpc*-*-* s390*-*-* sh*-*-*" } } } } */ +/* { dg-final { scan-tree-dump-times "struct _fat_ptr _ans" 0 "optimized" { target { ! "arm*-*-* nds32*-*-* powerpc*-*-* s390*-*-* sh*-*-*" } } } } */ +/* { dg-final { scan-tree-dump-times "struct _fat_ptr _T2" 0 "optimized" { target { ! "arm*-*-* nds32*-*-* powerpc*-*-* s390*-*-* sh*-*-*" } } } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ diff --git gcc/testsuite/gcc.dg/tree-ssa/sra-12.c gcc/testsuite/gcc.dg/tree-ssa/sra-12.c index 1ad3f49..59e5e6a 100644 --- gcc/testsuite/gcc.dg/tree-ssa/sra-12.c +++ gcc/testsuite/gcc.dg/tree-ssa/sra-12.c @@ -21,5 +21,5 @@ int foo (struct S *p) *p = l; } -/* { dg-final { scan-tree-dump-times "l;" 0 "release_ssa" { target { ! "avr*-*-*" } } } } */ +/* { dg-final { scan-tree-dump-times "l;" 0 "release_ssa" { target { ! "avr*-*-* nds32*-*-*" } } } } */ /* { dg-final { cleanup-tree-dump "release_ssa" } } */ diff --git gcc/testsuite/gcc.target/nds32/basic-main.c gcc/testsuite/gcc.target/nds32/basic-main.c new file mode 100644 index 0000000..a852b6e --- /dev/null +++ gcc/testsuite/gcc.target/nds32/basic-main.c @@ -0,0 +1,9 @@ +/* This is a basic main function test program. */ + +/* { dg-do run { target nds32*-*-* } } */ +/* { dg-options "-O0" } */ + +int main(void) +{ + return 0; +} diff --git gcc/testsuite/gcc.target/nds32/builtin-isb.c gcc/testsuite/gcc.target/nds32/builtin-isb.c new file mode 100644 index 0000000..90137cf --- /dev/null +++ gcc/testsuite/gcc.target/nds32/builtin-isb.c @@ -0,0 +1,11 @@ +/* Verify that we generate isb instruction with builtin function. */ + +/* { dg-do compile { target nds32*-*-* } } */ +/* { dg-options "-O0" } */ +/* { dg-final { scan-assembler "isb" } } */ + +void +test (void) +{ + __builtin_nds32_isb (); +} diff --git gcc/testsuite/gcc.target/nds32/builtin-isync.c gcc/testsuite/gcc.target/nds32/builtin-isync.c new file mode 100644 index 0000000..26f96f6 --- /dev/null +++ gcc/testsuite/gcc.target/nds32/builtin-isync.c @@ -0,0 +1,12 @@ +/* Verify that we generate isync instruction with builtin function. */ + +/* { dg-do compile { target nds32*-*-* } } */ +/* { dg-options "-O0" } */ +/* { dg-final { scan-assembler "isync" } } */ + +void +test (void) +{ + int *addr = (int *) 0x53000000; + __builtin_nds32_isync (addr); +} diff --git gcc/testsuite/gcc.target/nds32/builtin-mfsr-mtsr.c gcc/testsuite/gcc.target/nds32/builtin-mfsr-mtsr.c new file mode 100644 index 0000000..d024650 --- /dev/null +++ gcc/testsuite/gcc.target/nds32/builtin-mfsr-mtsr.c @@ -0,0 +1,17 @@ +/* Verify that we generate mfsr/mtsr instruction with builtin function. */ + +/* { dg-do compile { target nds32*-*-* } } */ +/* { dg-options "-O0" } */ +/* { dg-final { scan-assembler "mfsr" } } */ +/* { dg-final { scan-assembler "mtsr" } } */ + +#include + +void +test (void) +{ + int ipsw_value; + + ipsw_value = __builtin_nds32_mfsr (__NDS32_REG_IPSW__); + __builtin_nds32_mtsr (ipsw_value, __NDS32_REG_IPSW__); +} diff --git gcc/testsuite/gcc.target/nds32/builtin-mfusr-mtusr.c gcc/testsuite/gcc.target/nds32/builtin-mfusr-mtusr.c new file mode 100644 index 0000000..7dd0014 --- /dev/null +++ gcc/testsuite/gcc.target/nds32/builtin-mfusr-mtusr.c @@ -0,0 +1,17 @@ +/* Verify that we generate mfusr/mtusr instruction with builtin function. */ + +/* { dg-do compile { target nds32*-*-* } } */ +/* { dg-options "-O0" } */ +/* { dg-final { scan-assembler "mfusr" } } */ +/* { dg-final { scan-assembler "mtusr" } } */ + +#include + +void +test (void) +{ + int itype_value; + + itype_value = __builtin_nds32_mfusr (__NDS32_REG_ITYPE__); + __builtin_nds32_mtusr (itype_value, __NDS32_REG_ITYPE__); +} diff --git gcc/testsuite/gcc.target/nds32/builtin-setgie-dis.c gcc/testsuite/gcc.target/nds32/builtin-setgie-dis.c new file mode 100644 index 0000000..1cae2b0 --- /dev/null +++ gcc/testsuite/gcc.target/nds32/builtin-setgie-dis.c @@ -0,0 +1,11 @@ +/* Verify that we generate setgie.d instruction with builtin function. */ + +/* { dg-do compile { target nds32*-*-* } } */ +/* { dg-options "-O0" } */ +/* { dg-final { scan-assembler "setgie.d" } } */ + +void +test (void) +{ + __builtin_nds32_setgie_dis (); +} diff --git gcc/testsuite/gcc.target/nds32/builtin-setgie-en.c gcc/testsuite/gcc.target/nds32/builtin-setgie-en.c new file mode 100644 index 0000000..702ced0 --- /dev/null +++ gcc/testsuite/gcc.target/nds32/builtin-setgie-en.c @@ -0,0 +1,11 @@ +/* Verify that we generate setgie.e instruction with builtin function. */ + +/* { dg-do compile { target nds32*-*-* } } */ +/* { dg-options "-O0" } */ +/* { dg-final { scan-assembler "setgie.e" } } */ + +void +test (void) +{ + __builtin_nds32_setgie_en (); +} diff --git gcc/testsuite/gcc.target/nds32/nds32.exp gcc/testsuite/gcc.target/nds32/nds32.exp new file mode 100644 index 0000000..e88d022 --- /dev/null +++ gcc/testsuite/gcc.target/nds32/nds32.exp @@ -0,0 +1,45 @@ +# Target test cases of Andes NDS32 cpu for GNU compiler +# Copyright (C) 2012-2013 Free Software Foundation, Inc. +# Contributed by Andes Technology Corporation. +# +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published +# by the Free Software Foundation; either version 3, or (at your +# option) any later version. +# +# GCC is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +# License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# GCC testsuite that uses the `dg.exp' driver. + +# Exit immediately if this isn't a nds32 target. +if ![istarget nds32*-*-*] then { + return +} + +# Load support procs. +load_lib gcc-dg.exp + +# If a testcase doesn't have special options, use these. +global DEFAULT_CFLAGS +if ![info exists DEFAULT_CFLAGS] then { + set DEFAULT_CFLAGS " -ansi -pedantic-errors" +} + +# Initialize `dg'. +dg-init + +# Main loop. +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \ + "" $DEFAULT_CFLAGS + +# All done. +dg-finish diff --git gcc/testsuite/lib/target-supports.exp gcc/testsuite/lib/target-supports.exp index fe51fde..d7fcef7 100644 --- gcc/testsuite/lib/target-supports.exp +++ gcc/testsuite/lib/target-supports.exp @@ -529,6 +529,7 @@ proc check_profiling_available { test_what } { || [istarget mmix-*-*] || [istarget mn10300-*-elf*] || [istarget moxie-*-elf*] + || [istarget nds32*-*-elf] || [istarget picochip-*-*] || [istarget powerpc-*-eabi*] || [istarget powerpc-*-elf]