diff options
author | Andy Hutchinson <hutchinsonandy@aim.com> | 2008-06-02 22:39:12 +0000 |
---|---|---|
committer | Andy Hutchinson <hutchinsonandy@gcc.gnu.org> | 2008-06-02 22:39:12 +0000 |
commit | 7aa840fc5fc9531742f67871d6ee07a528660544 (patch) | |
tree | 0569ae5f7ff08b3fa5450a401242d28dc969226d | |
parent | ffd6ff7271cb576aa0d49e8939b0c4b3b7e9a720 (diff) | |
download | gcc-7aa840fc5fc9531742f67871d6ee07a528660544.zip gcc-7aa840fc5fc9531742f67871d6ee07a528660544.tar.gz gcc-7aa840fc5fc9531742f67871d6ee07a528660544.tar.bz2 |
avr.exp: Add avr testsuite.
* gcc.target/avr/avr.exp: Add avr testsuite.
* gcc.target/avr/trivial.c: Add simple test.
* gcc.target/avr/torture/avr-torture.exp: Add avr-torture testsuite.
* gcc.target/avr/torture/trivial.c: Add simple test.
From-SVN: r136304
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/avr/avr.exp | 41 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/avr/torture/avr-torture.exp | 61 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/avr/torture/trivial.c | 14 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/avr/trivial.c | 14 |
5 files changed, 137 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 67583a1..1f319a0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,12 @@ 2008-06-02 Andy Hutchinson <hutchinsonandy@aim.com> + * gcc.target/avr/avr.exp: Add avr testsuite. + * gcc.target/avr/trivial.c: Add simple test. + * gcc.target/avr/torture/avr-torture.exp: Add avr-torture testsuite. + * gcc.target/avr/torture/trivial.c: Add simple test. + +2008-06-02 Andy Hutchinson <hutchinsonandy@aim.com> + * gcc.dg/pr19340.c: Disable for AVR as it has no scheduling. * gcc.dg/section1.c: XFAIL AVR as bss section is used differently. diff --git a/gcc/testsuite/gcc.target/avr/avr.exp b/gcc/testsuite/gcc.target/avr/avr.exp new file mode 100644 index 0000000..90aeed4 --- /dev/null +++ b/gcc/testsuite/gcc.target/avr/avr.exp @@ -0,0 +1,41 @@ +# Copyright (C) 2008 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 AVR target.
+if ![istarget avr-*-*] 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
diff --git a/gcc/testsuite/gcc.target/avr/torture/avr-torture.exp b/gcc/testsuite/gcc.target/avr/torture/avr-torture.exp new file mode 100644 index 0000000..355b3ad --- /dev/null +++ b/gcc/testsuite/gcc.target/avr/torture/avr-torture.exp @@ -0,0 +1,61 @@ +# Copyright (C) 2008 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 `gcc-dg.exp' driver, looping over
+# optimization options.
+
+# Exit immediately if this isn't a AVR target.
+if { ![istarget avr-*-*] } 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
+
+ set AVR_TORTURE_OPTIONS [list \
+ { -O0 } \
+ { -O1 } \
+ { -O2 } \
+ { -O2 -mcall-prologues } \
+ { -Os -fomit-frame-pointer } \
+ { -Os -fomit-frame-pointer -finline-functions } \
+ { -O3 -g } \
+ { -Os -mcall-prologues} ]
+
+
+#Initialize use of torture lists.
+torture-init
+
+set-torture-options $AVR_TORTURE_OPTIONS
+
+
+# Main loop.
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] $DEFAULT_CFLAGS
+
+# Finalize use of torture lists.
+torture-finish
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.target/avr/torture/trivial.c b/gcc/testsuite/gcc.target/avr/torture/trivial.c new file mode 100644 index 0000000..91163f9 --- /dev/null +++ b/gcc/testsuite/gcc.target/avr/torture/trivial.c @@ -0,0 +1,14 @@ +/* { dg-do run } */
+#include <stdio.h>
+
+#define __ATTR_PROGMEM__ __attribute__((__progmem__))
+
+#define PROGMEM __ATTR_PROGMEM__
+char PROGMEM a1 = 0x12;
+int PROGMEM a2 = 0x2345;
+long PROGMEM a3 = 0x12345678;
+int main(void)
+{
+ printf("Hello World\n");
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.target/avr/trivial.c b/gcc/testsuite/gcc.target/avr/trivial.c new file mode 100644 index 0000000..91163f9 --- /dev/null +++ b/gcc/testsuite/gcc.target/avr/trivial.c @@ -0,0 +1,14 @@ +/* { dg-do run } */
+#include <stdio.h>
+
+#define __ATTR_PROGMEM__ __attribute__((__progmem__))
+
+#define PROGMEM __ATTR_PROGMEM__
+char PROGMEM a1 = 0x12;
+int PROGMEM a2 = 0x2345;
+long PROGMEM a3 = 0x12345678;
+int main(void)
+{
+ printf("Hello World\n");
+ return 0;
+}
|