aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/rotate-1a.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-05-10 10:40:10 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2013-05-10 10:40:10 +0200
commitcb3b8d33faa3a649b02827649f9c76e40edace15 (patch)
tree48fdd5402146ff7985941320929c5cda2e1a1c90 /gcc/testsuite/c-c++-common/rotate-1a.c
parentfb7f649d713491d28fd41f3ce12e474af03617df (diff)
downloadgcc-cb3b8d33faa3a649b02827649f9c76e40edace15.zip
gcc-cb3b8d33faa3a649b02827649f9c76e40edace15.tar.gz
gcc-cb3b8d33faa3a649b02827649f9c76e40edace15.tar.bz2
re PR tree-optimization/45216 (Rotate expressions not recognized at tree level)
PR tree-optimization/45216 PR tree-optimization/57157 * tree-ssa-forwprop.c (simplify_rotate): New function. (ssa_forward_propagate_and_combine): Call it. * c-c++-common/rotate-1.c: New test. * c-c++-common/rotate-1a.c: New test. * c-c++-common/rotate-2.c: New test. * c-c++-common/rotate-2a.c: New test. * c-c++-common/rotate-3.c: New test. * c-c++-common/rotate-3a.c: New test. * c-c++-common/rotate-4.c: New test. * c-c++-common/rotate-4a.c: New test. From-SVN: r198769
Diffstat (limited to 'gcc/testsuite/c-c++-common/rotate-1a.c')
-rw-r--r--gcc/testsuite/c-c++-common/rotate-1a.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/rotate-1a.c b/gcc/testsuite/c-c++-common/rotate-1a.c
new file mode 100644
index 0000000..fc838a8
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/rotate-1a.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -Wno-overflow" } */
+
+extern
+#ifdef __cplusplus
+"C"
+#endif
+void abort (void);
+
+#ifndef ROTATE_N
+#define ROTATE_N "rotate-1.c"
+#endif
+
+#include ROTATE_N
+
+unsigned int expected[] = {
+0x91a2b3c0, 0x91a2b3c0, 0x2468acf0, 0x91a2b3c, 0xb3c2, 0xb3c2, 0xc3, 0xc3,
+0x91a2b3c0, 0x91a2b3c0, 0x2468acf0, 0x91a2b3c, 0xb3c2, 0xb3c2, 0xc3, 0xc3,
+0x91a2b3c0, 0x91a2b3c0, 0x2468acf0, 0x91a2b3c, 0xb3c2, 0xb3c2, 0xc3, 0xc3,
+0x91a2b3c0, 0x91a2b3c0, 0x2468acf0, 0x91a2b3c, 0xb3c2, 0xb3c2, 0xc3, 0xc3,
+0x2468acf, 0x2468acf, 0x91a2b3c, 0x2468acf0, 0xacf, 0xacf, 0xf, 0xf,
+0x2468acf, 0x2468acf, 0x91a2b3c, 0x2468acf0, 0xacf, 0xacf, 0xf, 0xf,
+0x2468acf, 0x2468acf, 0x91a2b3c, 0x2468acf0, 0xacf, 0xacf, 0xf, 0xf,
+0x2468acf, 0x2468acf, 0x91a2b3c, 0x2468acf0, 0xacf, 0xacf, 0xf, 0xf };
+
+#define F(n) __typeof (f##n) f##n __attribute__((noinline, noclone));
+#define D(n) F(n##0) F(n##1) F(n##2) F(n##3) F(n##4) F(n##5) F(n##6) F(n##7) F(n##8) F(n##9)
+#define ALL \
+F(1) F(2) F(3) F(4) F(5) F(6) F(7) F(8) F(9) \
+D(1) D(2) D(3) D(4) D(5) F(60) F(61) F(62) F(63) F(64)
+ALL
+
+int
+main ()
+{
+#if __CHAR_BIT__ != 8 || __SIZEOF_SHORT__ != 2 || __SIZEOF_INT__ != 4
+ return 0;
+#else
+#undef F
+#define F(n) if ((unsigned int) f##n (0x12345678U, 3) != expected[n - 1]) abort ();
+ ALL
+ return 0;
+#endif
+}