diff options
author | Roman Zippel <zippel@gcc.gnu.org> | 2007-03-04 00:58:06 +0000 |
---|---|---|
committer | Roman Zippel <zippel@gcc.gnu.org> | 2007-03-04 00:58:06 +0000 |
commit | dda10672f1a0f505dd6f8133a5483b8ee846f233 (patch) | |
tree | d5f4501d40f4b53ef2769e4b44b37e6de37cf55a /gcc | |
parent | 594f8779730a86ee3e34f05c012e23592649bac5 (diff) | |
download | gcc-dda10672f1a0f505dd6f8133a5483b8ee846f233.zip gcc-dda10672f1a0f505dd6f8133a5483b8ee846f233.tar.gz gcc-dda10672f1a0f505dd6f8133a5483b8ee846f233.tar.bz2 |
m68k.exp: New.
* gcc.target/m68k/m68k.exp: New.
* gcc.target/m68k/crash1.c: New.
From-SVN: r122521
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.target/m68k/crash1.c | 42 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/m68k/m68k.exp | 41 |
2 files changed, 83 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/m68k/crash1.c b/gcc/testsuite/gcc.target/m68k/crash1.c new file mode 100644 index 0000000..fdd737a --- /dev/null +++ b/gcc/testsuite/gcc.target/m68k/crash1.c @@ -0,0 +1,42 @@ +/* { dg-do compile } */ +/* { dg-options "-Os -fomit-frame-pointer" } */ + +/* Caused an ICE because of forgotten auto increment. */ + +register void *current __asm__("%a2"); + +struct kernel_stat +{ + long long user; + long long nice; + long long system; + long long idle; + long long steal; + unsigned irqs[256]; +}; +extern struct kernel_stat per_cpu__kstat; + +void show_stat(void) +{ + int i; + long long user, nice, system, idle, steal; + long long sum = 0; + + user = nice = system = idle = steal = 0; + for (i = 0; i < 1; i++) + { + int j; + user = user + per_cpu__kstat.user; + nice = nice + per_cpu__kstat.nice; + system = system + per_cpu__kstat.system; + idle = idle + per_cpu__kstat.idle; + steal = steal + per_cpu__kstat.steal; + + for (j = 0 ; j < 256 ; j++) + sum += per_cpu__kstat.irqs[j]; + } + seq_printf(user, nice, system, idle, steal); + seq_printf(sum); + for (i = 0; i < 256; i++) + seq_printf (i); +} diff --git a/gcc/testsuite/gcc.target/m68k/m68k.exp b/gcc/testsuite/gcc.target/m68k/m68k.exp new file mode 100644 index 0000000..9398d10 --- /dev/null +++ b/gcc/testsuite/gcc.target/m68k/m68k.exp @@ -0,0 +1,41 @@ +# Copyright (C) 1997, 2004, 2006 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 2 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 this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# GCC testsuite that uses the `dg.exp' driver. + +# Exit immediately if this isn't an m68k target. +if ![istarget m68k*-*-*] 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 |