summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/smod-1.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-18 22:45:01 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-18 22:45:01 +0000
commit4b05206ee786b567549ae4449c71b9e3a23e9acc (patch)
treeb0c124b89ea7d242ab3f64d6e1c138f7212d1c0c /gcc/testsuite/gcc.dg/smod-1.c
parent568e9a9cc465c10dfb4c6aeb30084fb1939b1a5b (diff)
downloadgcc-4b05206ee786b567549ae4449c71b9e3a23e9acc.tar.gz
PR middle-end/18045
* expmed.c (expand_smod_pow2): Handle modes whose size is greater than that of HOST_WIDE_INT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89253 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/smod-1.c')
-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 00000000000..18c43ee5df4
--- /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;
+}