From 4baa25d3fbee279835c1e7e53ef1460d41291b28 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Fri, 16 Jan 2015 12:21:32 +0000 Subject: [PATCH] * gcc.target/visium: New directory. From-SVN: r219728 --- gcc/testsuite/ChangeLog | 4 ++ gcc/testsuite/gcc.target/visium/bit_shift.c | 13 ++++++ gcc/testsuite/gcc.target/visium/bit_test.c | 31 +++++++++++++ gcc/testsuite/gcc.target/visium/block_move.c | 19 ++++++++ gcc/testsuite/gcc.target/visium/cstore_eq.c | 25 +++++++++++ gcc/testsuite/gcc.target/visium/cstore_fp.c | 25 +++++++++++ gcc/testsuite/gcc.target/visium/cstore_uns.c | 25 +++++++++++ gcc/testsuite/gcc.target/visium/long_branch.c | 27 ++++++++++++ gcc/testsuite/gcc.target/visium/loop_clear.c | 15 +++++++ gcc/testsuite/gcc.target/visium/visium.exp | 44 +++++++++++++++++++ 10 files changed, 228 insertions(+) create mode 100644 gcc/testsuite/gcc.target/visium/bit_shift.c create mode 100644 gcc/testsuite/gcc.target/visium/bit_test.c create mode 100644 gcc/testsuite/gcc.target/visium/block_move.c create mode 100644 gcc/testsuite/gcc.target/visium/cstore_eq.c create mode 100644 gcc/testsuite/gcc.target/visium/cstore_fp.c create mode 100644 gcc/testsuite/gcc.target/visium/cstore_uns.c create mode 100644 gcc/testsuite/gcc.target/visium/long_branch.c create mode 100644 gcc/testsuite/gcc.target/visium/loop_clear.c create mode 100644 gcc/testsuite/gcc.target/visium/visium.exp diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 29adc51d6d1..ac7c7f296b4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-01-16 Eric Botcazou + + * gcc.target/visium: New directory. + 2015-01-16 Richard Biener PR tree-optimization/61743 diff --git a/gcc/testsuite/gcc.target/visium/bit_shift.c b/gcc/testsuite/gcc.target/visium/bit_shift.c new file mode 100644 index 00000000000..bf373428de8 --- /dev/null +++ b/gcc/testsuite/gcc.target/visium/bit_shift.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +int bit_shift (long int x) +{ + int i, n; + + for (i = n = 0; x && (i < (sizeof(long) * 8)); ++i, x >>= 1) + n += (int)(x & 1L); + return n; +} + +/* { dg-final { scan-assembler-not "cmp" } } */ diff --git a/gcc/testsuite/gcc.target/visium/bit_test.c b/gcc/testsuite/gcc.target/visium/bit_test.c new file mode 100644 index 00000000000..2de9208f4b0 --- /dev/null +++ b/gcc/testsuite/gcc.target/visium/bit_test.c @@ -0,0 +1,31 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +extern void bar (void); + +void foo1 (unsigned int i) +{ + if (i & 4) + bar (); +} + +void foo2 (unsigned int i) +{ + if (i & 0x80000000) + bar (); +} + +void foo3 (unsigned char c) +{ + if (c & 4) + bar (); +} + +void foo4 (unsigned char c) +{ + if (c & 0x80) + bar (); +} + +/* { dg-final { scan-assembler-times "lsr.l" 2 } } */ +/* { dg-final { scan-assembler-times "cmp" 2 } } */ diff --git a/gcc/testsuite/gcc.target/visium/block_move.c b/gcc/testsuite/gcc.target/visium/block_move.c new file mode 100644 index 00000000000..a9e352241b2 --- /dev/null +++ b/gcc/testsuite/gcc.target/visium/block_move.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mcpu=gr6" } */ + +extern void abort (void); + +#define LEN 256 + +void foo (void) +{ + int dst[LEN], src[LEN]; + unsigned int i; + + __builtin_memset (src, 0, LEN * sizeof (int)); + __builtin_memcpy (dst, src, LEN * sizeof (int)); + if (__builtin_memcmp (dst, src, LEN * sizeof (int)) != 0) + abort (); +} + +/* { dg-final { scan-assembler "bmd" } } */ diff --git a/gcc/testsuite/gcc.target/visium/cstore_eq.c b/gcc/testsuite/gcc.target/visium/cstore_eq.c new file mode 100644 index 00000000000..2bc132a36c2 --- /dev/null +++ b/gcc/testsuite/gcc.target/visium/cstore_eq.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +int foo1 (int i) +{ + return (i != 0); +} + +int foo2 (int i) +{ + return (i == 0); +} + +int foo3 (int a, int b) +{ + return a != b; +} + +int foo4 (int a, int b) +{ + return (a == b); +} + +/* { dg-final { scan-assembler-times "adc.l" 2 } } */ +/* { dg-final { scan-assembler-times "subc.l" 2 } } */ diff --git a/gcc/testsuite/gcc.target/visium/cstore_fp.c b/gcc/testsuite/gcc.target/visium/cstore_fp.c new file mode 100644 index 00000000000..8849d1faba8 --- /dev/null +++ b/gcc/testsuite/gcc.target/visium/cstore_fp.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fno-trapping-math" } */ + +int foo1 (float a, float b) +{ + return (a < b); +} + +int foo2 (float a, float b) +{ + return (a > b); +} + +int foo3 (float a, float b) +{ + return !(a < b); +} + +int foo4 (float a, float b) +{ + return !(a > b); +} + +/* { dg-final { scan-assembler-times "adc.l" 2 } } */ +/* { dg-final { scan-assembler-times "subc.l" 2 } } */ diff --git a/gcc/testsuite/gcc.target/visium/cstore_uns.c b/gcc/testsuite/gcc.target/visium/cstore_uns.c new file mode 100644 index 00000000000..c60f984a13a --- /dev/null +++ b/gcc/testsuite/gcc.target/visium/cstore_uns.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +int foo1 (unsigned a, unsigned b) +{ + return (a < b); +} + +int foo2 (unsigned a, unsigned b) +{ + return (a > b); +} + +int foo3 (unsigned a, unsigned b) +{ + return (a >= b); +} + +int foo4 (unsigned a, unsigned b) +{ + return (a <= b); +} + +/* { dg-final { scan-assembler-times "adc.l" 2 } } */ +/* { dg-final { scan-assembler-times "subc.l" 2 } } */ diff --git a/gcc/testsuite/gcc.target/visium/long_branch.c b/gcc/testsuite/gcc.target/visium/long_branch.c new file mode 100644 index 00000000000..a53537a1537 --- /dev/null +++ b/gcc/testsuite/gcc.target/visium/long_branch.c @@ -0,0 +1,27 @@ +/* { dg-do assemble } */ + +volatile int k = 0; + +#define ONE k++; +#define TEN ONE ONE ONE ONE ONE ONE ONE ONE ONE ONE +#define HUN TEN TEN TEN TEN TEN TEN TEN TEN TEN TEN +#define THO HUN HUN HUN HUN HUN HUN HUN HUN HUN HUN +#define TTH THO THO THO THO THO THO THO THO THO THO THO + +void foo (void) +{ + start: + TTH + __asm__ __volatile__ ("" : : : "r28"); + goto start; +} + +#ifndef __OPTIMIZE__ +void bar (int i) +{ + if (i > 0) + { + TTH + } +} +#endif diff --git a/gcc/testsuite/gcc.target/visium/loop_clear.c b/gcc/testsuite/gcc.target/visium/loop_clear.c new file mode 100644 index 00000000000..740e9d2cd67 --- /dev/null +++ b/gcc/testsuite/gcc.target/visium/loop_clear.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +extern int a[]; + +void loop_clear (int i) +{ + while (i > 0) + a[i--] = 0; +} + +/* { dg-final { scan-assembler-times "cmp" 1 { xfail *-*-* } } } */ + +/* FIXME: the redundant cmp is not eliminated because the compare-elim pass + is run before the dbr pass. It's a regression wrt the cc0 port. */ diff --git a/gcc/testsuite/gcc.target/visium/visium.exp b/gcc/testsuite/gcc.target/visium/visium.exp new file mode 100644 index 00000000000..5c179a7e26b --- /dev/null +++ b/gcc/testsuite/gcc.target/visium/visium.exp @@ -0,0 +1,44 @@ +# Specific regression driver for Visium. +# Copyright (C) 2015 Free Software Foundation, Inc. +# +# 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 Visium target. +if {![istarget visium-*-*] } 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/*.\[cCS\]]] \ + "" $DEFAULT_CFLAGS + +# All done. +dg-finish -- 2.30.2