Commit 4baa25d3 by Eric Botcazou Committed by Eric Botcazou

* gcc.target/visium: New directory.

From-SVN: r219728
parent a3f97e03
2015-01-16 Eric Botcazou <ebotcazou@adacore.com>
* gcc.target/visium: New directory.
2015-01-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/61743
......
/* { 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" } } */
/* { 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 } } */
/* { 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" } } */
/* { 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 } } */
/* { 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 } } */
/* { 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 } } */
/* { 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
/* { 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. */
# 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
# <http://www.gnu.org/licenses/>. */
# 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment