OSDN Git Service

* gcc.target/avr/avr.exp: Add avr testsuite.
authorhutchinsonandy <hutchinsonandy@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 2 Jun 2008 22:39:12 +0000 (22:39 +0000)
committerhutchinsonandy <hutchinsonandy@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 2 Jun 2008 22:39:12 +0000 (22:39 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136304 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/avr/avr.exp [new file with mode: 0644]
gcc/testsuite/gcc.target/avr/torture/avr-torture.exp [new file with mode: 0644]
gcc/testsuite/gcc.target/avr/torture/trivial.c [new file with mode: 0644]
gcc/testsuite/gcc.target/avr/trivial.c [new file with mode: 0644]

index 67583a1..1f319a0 100644 (file)
@@ -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 (file)
index 0000000..90aeed4
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright (C) 2008 Free Software Foundation, Inc.\r
+\r
+# This program is free software; you can redistribute it and/or modify\r
+# it under the terms of the GNU General Public License as published by\r
+# the Free Software Foundation; either version 3 of the License, or\r
+# (at your option) any later version.\r
+# \r
+# This program is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+# GNU General Public License for more details.\r
+# \r
+# You should have received a copy of the GNU General Public License\r
+# along with GCC; see the file COPYING3.  If not see\r
+# <http://www.gnu.org/licenses/>.\r
+\r
+# GCC testsuite that uses the `dg.exp' driver.\r
+\r
+# Exit immediately if this isn't an AVR target.\r
+if ![istarget avr-*-*] then {\r
+  return\r
+}\r
+\r
+# Load support procs.\r
+load_lib gcc-dg.exp\r
+\r
+# If a testcase doesn't have special options, use these.\r
+global DEFAULT_CFLAGS\r
+if ![info exists DEFAULT_CFLAGS] then {\r
+    set DEFAULT_CFLAGS " -ansi -pedantic-errors"\r
+}\r
+\r
+# Initialize `dg'.\r
+dg-init\r
+\r
+# Main loop.\r
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \\r
+       "" $DEFAULT_CFLAGS\r
+\r
+# All done.\r
+dg-finish\r
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 (file)
index 0000000..355b3ad
--- /dev/null
@@ -0,0 +1,61 @@
+#   Copyright (C) 2008 Free Software Foundation, Inc.\r
+\r
+# This program is free software; you can redistribute it and/or modify\r
+# it under the terms of the GNU General Public License as published by\r
+# the Free Software Foundation; either version 3 of the License, or\r
+# (at your option) any later version.\r
+# \r
+# This program is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+# GNU General Public License for more details.\r
+# \r
+# You should have received a copy of the GNU General Public License\r
+# along with GCC; see the file COPYING3.  If not see\r
+# <http://www.gnu.org/licenses/>.\r
+\r
+# GCC testsuite that uses the `gcc-dg.exp' driver, looping over\r
+# optimization options.\r
+\r
+# Exit immediately if this isn't a AVR target.\r
+if { ![istarget avr-*-*] } then {\r
+  return\r
+}\r
+\r
+# Load support procs.\r
+load_lib gcc-dg.exp\r
+\r
+# If a testcase doesn't have special options, use these.\r
+global DEFAULT_CFLAGS\r
+if ![info exists DEFAULT_CFLAGS] then {\r
+    set DEFAULT_CFLAGS " -ansi -pedantic-errors"\r
+}\r
+\r
+# Initialize `dg'.\r
+dg-init\r
+\r
+    set AVR_TORTURE_OPTIONS [list \\r
+       { -O0 } \\r
+       { -O1 } \\r
+       { -O2 } \\r
+       { -O2 -mcall-prologues } \\r
+       { -Os -fomit-frame-pointer } \\r
+       { -Os -fomit-frame-pointer -finline-functions } \\r
+       { -O3 -g } \\r
+       { -Os -mcall-prologues} ]\r
+\r
+\r
+#Initialize use of torture lists. \r
+torture-init\r
+\r
+set-torture-options $AVR_TORTURE_OPTIONS\r
+\r
+\r
+# Main loop.\r
+gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] $DEFAULT_CFLAGS\r
+\r
+# Finalize use of torture lists.\r
+torture-finish\r
+\r
+# All done.\r
+dg-finish\r
diff --git a/gcc/testsuite/gcc.target/avr/torture/trivial.c b/gcc/testsuite/gcc.target/avr/torture/trivial.c
new file mode 100644 (file)
index 0000000..91163f9
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do run } */\r
+#include <stdio.h>\r
+\r
+#define __ATTR_PROGMEM__ __attribute__((__progmem__))\r
+\r
+#define PROGMEM __ATTR_PROGMEM__\r
+char PROGMEM a1 = 0x12; \r
+int PROGMEM a2 = 0x2345; \r
+long PROGMEM a3 = 0x12345678; \r
+int main(void)\r
+{\r
+  printf("Hello World\n");\r
+  return 0;\r
+}\r
diff --git a/gcc/testsuite/gcc.target/avr/trivial.c b/gcc/testsuite/gcc.target/avr/trivial.c
new file mode 100644 (file)
index 0000000..91163f9
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do run } */\r
+#include <stdio.h>\r
+\r
+#define __ATTR_PROGMEM__ __attribute__((__progmem__))\r
+\r
+#define PROGMEM __ATTR_PROGMEM__\r
+char PROGMEM a1 = 0x12; \r
+int PROGMEM a2 = 0x2345; \r
+long PROGMEM a3 = 0x12345678; \r
+int main(void)\r
+{\r
+  printf("Hello World\n");\r
+  return 0;\r
+}\r