aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2004-10-19 00:45:01 +0200
committerEric Botcazou <ebotcazou@gcc.gnu.org>2004-10-18 22:45:01 +0000
commit6e7a355c164ab9adb03365f83f864b8e2c201c23 (patch)
treeb0c124b89ea7d242ab3f64d6e1c138f7212d1c0c /gcc/testsuite/gcc.dg
parentd4de696663ca16f677477d6a74de68b690bf66e0 (diff)
downloadgcc-6e7a355c164ab9adb03365f83f864b8e2c201c23.zip
gcc-6e7a355c164ab9adb03365f83f864b8e2c201c23.tar.gz
gcc-6e7a355c164ab9adb03365f83f864b8e2c201c23.tar.bz2
re PR middle-end/18045 (signed integer remainder for power of 2 broken)
PR middle-end/18045 * expmed.c (expand_smod_pow2): Handle modes whose size is greater than that of HOST_WIDE_INT. From-SVN: r89253
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/smod-1.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/smod-1.c b/gcc/testsuite/gcc.dg/smod-1.c
new file mode 100644
index 0000000..18c43ee
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/smod-1.c
@@ -0,0 +1,25 @@
+/* PR middle-end/18045 */
+/* Contributed by Eric Botcazou <ebotcazou@libertysurf.fr> */
+
+/* { dg-do run } */
+/* { dg-options "-std=c99" } */
+/* { dg-options "-std=c99 -mtune=i486" { target i?86-*-* x86_64-*-* } } */
+
+#include <limits.h>
+
+extern void abort(void);
+
+long long smod16(long long x)
+{
+ return x % 16;
+}
+
+int main(void)
+{
+#if LLONG_MAX > 2147483647L
+ if (smod16 (0xFFFFFFFF) != 0xF)
+ abort ();
+#endif
+
+ return 0;
+}