diff options
author | Ben Cheng <bccheng@google.com> | 2014-03-25 22:37:19 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2014-03-25 22:37:19 -0700 |
commit | 1bc5aee63eb72b341f506ad058502cd0361f0d10 (patch) | |
tree | c607e8252f3405424ff15bc2d00aa38dadbb2518 /gcc-4.9/gcc/testsuite/gcc.target/epiphany | |
parent | 283a0bf58fcf333c58a2a92c3ebbc41fb9eb1fdb (diff) | |
download | toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.gz toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.bz2 toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.zip |
Initial checkin of GCC 4.9.0 from trunk (r208799).
Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/epiphany')
6 files changed, 126 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/epiphany/epiphany.exp b/gcc-4.9/gcc/testsuite/gcc.target/epiphany/epiphany.exp new file mode 100644 index 000000000..59226ae15 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/epiphany/epiphany.exp @@ -0,0 +1,41 @@ +# Copyright (C) 2007-2014 Free Software Foundation, Inc. + +# This program 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 of the License, or +# (at your option) any later version. +# +# This program 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 +# <http://www.gnu.org/licenses/>. + +# GCC testsuite that uses the `dg.exp' driver. + +# Exit immediately if this isn't an epiphany target. +if ![istarget epiphany*-*-*] 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 a/gcc-4.9/gcc/testsuite/gcc.target/epiphany/fmadd-1.c b/gcc-4.9/gcc/testsuite/gcc.target/epiphany/fmadd-1.c new file mode 100644 index 000000000..868d5bd02 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/epiphany/fmadd-1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler-times "fmadd\[ \ta-zA-Z0-9\]*," 2 } } */ + +#include <epiphany_intrinsics.h> + +float +f1 (float a, float b, float c) +{ + return __builtin_epiphany_fmadd (a, b, c); +} + +float +f2 (float a, float b, float c) +{ + return a + b * c; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/epiphany/fmsub-1.c b/gcc-4.9/gcc/testsuite/gcc.target/epiphany/fmsub-1.c new file mode 100644 index 000000000..ff7fefa7f --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/epiphany/fmsub-1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler-times "fmsub\[ \ta-zA-Z0-9\]*," 2 } } */ + +#include <epiphany_intrinsics.h> + +float +f1 (float a, float b, float c) +{ + return __builtin_epiphany_fmsub (a, b, c); +} + +float +f2 (float a, float b, float c) +{ + return a - b * c; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/epiphany/fnma-1.c b/gcc-4.9/gcc/testsuite/gcc.target/epiphany/fnma-1.c new file mode 100644 index 000000000..3155079f4 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/epiphany/fnma-1.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-final { scan-assembler-times "fmsub\[ \ta-zA-Z0-9\]*," 1 } } */ + +float +f (float ar, float ai, float br, float bi) +{ + return ar * br - ai * bi; +} diff --git a/gcc-4.9/gcc/testsuite/gcc.target/epiphany/interrupt-2.c b/gcc-4.9/gcc/testsuite/gcc.target/epiphany/interrupt-2.c new file mode 100644 index 000000000..4c0de6c5d --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/epiphany/interrupt-2.c @@ -0,0 +1,24 @@ +/* { dg-options "-g" } */ + +void __attribute__((interrupt)) +universal_handler (void) +{ +} + +void __attribute__((interrupt("dma0","Vss","dma1"))) +g (void) +{ /* { dg-warning "is not \"reset\"" } */ +} + +void __attribute__((interrupt("dma0","dma1","timer1","reset"), + forwarder_section("test"))) +misc_handler (void) +{ +} + +void __attribute__((interrupt(dma0,42))) +h (void) +{ /* { dg-warning "is not a string constant" } */ +} + +/* { dg-final { scan-assembler-times "b\[ \t\]*_misc_handler" 4 } } */ diff --git a/gcc-4.9/gcc/testsuite/gcc.target/epiphany/interrupt.c b/gcc-4.9/gcc/testsuite/gcc.target/epiphany/interrupt.c new file mode 100644 index 000000000..86fb25561 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.target/epiphany/interrupt.c @@ -0,0 +1,18 @@ +/* { dg-options "-g" } */ + +void __attribute__((interrupt("dma0"))) +dma0_handler (void) +{ +} + +void __attribute__((interrupt("Vss"))) +g (void) +{ /* { dg-warning "is not \"reset\"" } */ +} + +void __attribute__((interrupt(42))) +h (void) +{ /* { dg-warning "is not a string constant" } */ +} + +/* { dg-final { scan-assembler-times "b\[ \t\]*_dma0_handler" 1 } } */ |