diff options
| author | zippel <zippel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-04 00:58:06 +0000 |
|---|---|---|
| committer | zippel <zippel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-04 00:58:06 +0000 |
| commit | 608ae6a84a7e227cd5ef57728b949b5db9beed0c (patch) | |
| tree | d5f4501d40f4b53ef2769e4b44b37e6de37cf55a | |
| parent | 698ff1f08ba81e795227acd758edb5d9173fee5b (diff) | |
| download | ppe42-gcc-608ae6a84a7e227cd5ef57728b949b5db9beed0c.tar.gz ppe42-gcc-608ae6a84a7e227cd5ef57728b949b5db9beed0c.zip | |
* gcc.target/m68k/m68k.exp: New.
* gcc.target/m68k/crash1.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122521 138bc75d-0d04-0410-961f-82ee72b054a4
| -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 00000000000..fdd737ab238 --- /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 00000000000..9398d109cc6 --- /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 |

