aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaushik Phatak <kaushik.phatak@kpitcummins.com>2010-03-10 15:48:52 +0000
committerJeff Law <law@gcc.gnu.org>2010-03-10 08:48:52 -0700
commit8bb025f55a97aec05b9aaff2147b2df6009e90ad (patch)
tree15ade9bede59e95f6c0c960d0743899d139e9bb0 /gcc
parent6edd81980fbf769971b1e77bb1d679b329d2255a (diff)
downloadgcc-8bb025f55a97aec05b9aaff2147b2df6009e90ad.zip
gcc-8bb025f55a97aec05b9aaff2147b2df6009e90ad.tar.gz
gcc-8bb025f55a97aec05b9aaff2147b2df6009e90ad.tar.bz2
h8300-div-delay-slot.c: New test.
* gcc.dg/h8300-div-delay-slot.c: New test. From-SVN: r157340
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/h8300-div-delay-slot.c19
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index edb88dd..e58f57d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2010-03-10 Kaushik Phatak <kaushik.phatak@kpitcummins.com>
+
+ * gcc.dg/h8300-div-delay-slot.c: New test.
+
2010-03-10 Alexander Monakov <amonakov@ispras.ru>
PR tree-optimization/43236
diff --git a/gcc/testsuite/gcc.dg/h8300-div-delay-slot.c b/gcc/testsuite/gcc.dg/h8300-div-delay-slot.c
new file mode 100644
index 0000000..5fa60ec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/h8300-div-delay-slot.c
@@ -0,0 +1,19 @@
+/* Make sure that the H8 backend does not generate a div
+ instruction in a delay slot. */
+/* { dg-options "-Os" } */
+/* { dg-skip-if "" { "h8300*-*-*" } "*" "-msx*" } */
+/* { dg-final { scan-assembler-not "\tbra/s\t.*\n\tdiv*" } } */
+
+extern volatile unsigned long timer_ticks;
+#define timer_ms_elapsed(ticks) (((unsigned long)(timer_ticks-ticks))/10)
+unsigned long ticks;
+
+unsigned tst_read( unsigned char idx )
+{
+ switch( idx )
+ {
+ case 0x62: return timer_ms_elapsed(ticks);
+ case 0x61: return timer_ticks;
+ default: return 0;
+ }
+}