aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2000-06-15 17:25:52 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2000-06-15 17:25:52 +0200
commitd2f7db1d9db6d315a0dadff5c04849cd7a67d82e (patch)
tree2a522cde3fe96fe79c8a80f3f05d8b6ea14d17e6
parent1bf8972740dc40b4811f0be0e7ae2ff773964cdc (diff)
downloadgcc-d2f7db1d9db6d315a0dadff5c04849cd7a67d82e.zip
gcc-d2f7db1d9db6d315a0dadff5c04849cd7a67d82e.tar.gz
gcc-d2f7db1d9db6d315a0dadff5c04849cd7a67d82e.tar.bz2
20000614-1.c: New test.
* gcc.dg/20000614-1.c: New test. * gcc.dg/20000614-2.c: New test. From-SVN: r34564
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/20000614-1.c23
-rw-r--r--gcc/testsuite/gcc.dg/20000614-2.c27
3 files changed, 55 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 64c98be..24377d2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-14 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/20000614-1.c: New test.
+ * gcc.dg/20000614-2.c: New test.
+
2000-06-14 Hans-Peter Nilsson <hp@axis.com>
* g++.old-deja/g++.other/inline12.C: New test.
diff --git a/gcc/testsuite/gcc.dg/20000614-1.c b/gcc/testsuite/gcc.dg/20000614-1.c
new file mode 100644
index 0000000..62d9b29
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20000614-1.c
@@ -0,0 +1,23 @@
+/* { dg-do run { target i?86-*-* } } */
+/* { dg-options "-O2" } */
+
+void bar(char *p)
+{
+}
+
+static inline void foo (unsigned long base, unsigned char val)
+{
+ val ^= (1<<2);
+ bar (val & (1<<5) ? "1" : "2");
+ bar (val & (1<<4) ? "1" : "2");
+ bar (val & (1<<3) ? "1" : "2");
+ bar (val & (1<<2) ? "1" : "2");
+ bar (val & (1<<1) ? "1" : "2");
+ bar (val & (1<<0) ? "1" : "2");
+ asm volatile ("": :"a" (val), "d" (base));
+}
+
+int main (void)
+{
+ foo (23, 1);
+}
diff --git a/gcc/testsuite/gcc.dg/20000614-2.c b/gcc/testsuite/gcc.dg/20000614-2.c
new file mode 100644
index 0000000..18d42ec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20000614-2.c
@@ -0,0 +1,27 @@
+/* { dg-do run { target i?86-*-* } } */
+/* { dg-options "-O2 -fno-strength-reduce" } */
+
+void bar(char *p)
+{
+}
+
+int main()
+{
+ union {
+ unsigned int val;
+ unsigned char p[4];
+ } serial;
+ char buf[8];
+ int i;
+
+ serial.val = 0;
+ bar(buf);
+ for(i = 0; i < 8; i += 4)
+ {
+ serial.p [0] += buf [i + 0];
+ serial.p [1] += buf [i + 1];
+ serial.p [2] += buf [i + 2];
+ serial.p [3] += buf [i + 3];
+ }
+ return serial.val;
+}