aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-12-02 11:10:38 +0000
committerNick Clifton <nickc@gcc.gnu.org>2004-12-02 11:10:38 +0000
commit1a06672a3b58bef4a4386ca3e24cc17c13d5959a (patch)
tree45c5e24f9d7c127c184cbd573e3c083597b9f8d6 /gcc
parent4cf93d7c059a8e92a216d67513df396d7b9efc6f (diff)
downloadgcc-1a06672a3b58bef4a4386ca3e24cc17c13d5959a.zip
gcc-1a06672a3b58bef4a4386ca3e24cc17c13d5959a.tar.gz
gcc-1a06672a3b58bef4a4386ca3e24cc17c13d5959a.tar.bz2
xstormy16: New test directory.
* gcc.target/xstormy16: New test directory. * gcc.target/xstormy16/xstormy16.exp: Run the new tests. * gcc.target/xstormy16/bp.c: Check the generation of bp instructions. * gcc.target/xstormy16/below_100.c: Check the generation of bp and bn instructions and the BELOW100 attribute. From-SVN: r91627
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog9
-rw-r--r--gcc/testsuite/gcc.target/xstormy16/below_100.c30
-rw-r--r--gcc/testsuite/gcc.target/xstormy16/bp.c34
-rw-r--r--gcc/testsuite/gcc.target/xstormy16/xstormy16.exp23
4 files changed, 96 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 432c67e..7842f63 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2004-12-02 Nick Clifton <nickc@redhat.com>
+
+ * gcc.target/xstormy16: New test directory.
+ * gcc.target/xstormy16/xstormy16.exp: Run the new tests.
+ * gcc.target/xstormy16/bp.c: Check the generation of bp
+ instructions.
+ * gcc.target/xstormy16/below_100.c: Check the generation of bp and
+ bn instructions and the BELOW100 attribute.
+
2004-12-02 Alan Modra <amodra@bigpond.net.au>
PR target/16952
diff --git a/gcc/testsuite/gcc.target/xstormy16/below_100.c b/gcc/testsuite/gcc.target/xstormy16/below_100.c
new file mode 100644
index 0000000..dfa7e3b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/xstormy16/below_100.c
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler "bn " } } */
+/* { dg-final { scan-assembler "bp " } } */
+
+unsigned short a_below __attribute__((__BELOW100__));
+unsigned short b_below __attribute__((__BELOW100__));
+unsigned short * a_ptr = & a_below;
+unsigned short * b_ptr = & b_below;
+
+char *
+foo (void)
+{
+ if (a_below & 0x0100)
+ {
+ if (b_below & 0x0100)
+ return "Fail";
+ return "Success";
+ }
+
+ return "Fail";
+}
+
+char *
+bar (void)
+{
+ *a_ptr = 0x0100;
+ *b_ptr = 0xfeff;
+ return foo ();
+}
diff --git a/gcc/testsuite/gcc.target/xstormy16/bp.c b/gcc/testsuite/gcc.target/xstormy16/bp.c
new file mode 100644
index 0000000..5cab932
--- /dev/null
+++ b/gcc/testsuite/gcc.target/xstormy16/bp.c
@@ -0,0 +1,34 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler "bp " } } */
+
+#define a_val (*((volatile unsigned char *) 0x7f14))
+#define b_val (*((volatile unsigned char *) 0x7f10))
+
+unsigned char * a_ptr = (unsigned char *) 0x7f14;
+unsigned char * b_ptr = (unsigned char *) 0x7f10;
+
+int
+foo (void)
+{
+ if (a_val & 0x08)
+ {
+ if (b_val & 0x08)
+ return -1;
+
+ return 0;
+ }
+
+ return -1;
+}
+
+int
+bar (void)
+{
+ *a_ptr = 0x08;
+ *b_ptr = 0xf7;
+
+ return foo ();
+}
+
+
diff --git a/gcc/testsuite/gcc.target/xstormy16/xstormy16.exp b/gcc/testsuite/gcc.target/xstormy16/xstormy16.exp
new file mode 100644
index 0000000..2961cf1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/xstormy16/xstormy16.exp
@@ -0,0 +1,23 @@
+# Tests for the xstormy16
+
+if {![istarget xstormy16-*-*]} {
+ return 0
+}
+
+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/*.\[cS\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish