pkgsrc-ng/lang/gcc45/patches/patch-gcc_testsuite_gcc.target_i386_pr49920.c
Lionel Sambuc 612ad0a18c lang/gcc45
2016-01-22 00:09:29 +01:00

29 lines
808 B
C

$NetBSD$
--- gcc/testsuite/gcc.target/i386/pr49920.c.orig Wed May 21 19:48:58 2014
+++ gcc/testsuite/gcc.target/i386/pr49920.c
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target ilp32 } */
+
+typedef __SIZE_TYPE__ size_t;
+extern void *malloc (size_t);
+
+register unsigned int MR_mr0 asm ("esi");
+register unsigned int MR_mr1 asm ("edi");
+
+void ml_backend__ml_closure_gen_module11 (void)
+{
+ unsigned int MR_tempr1, MR_tempr2, MR_tempr3;
+
+ MR_tempr1 = (unsigned int)((char *) malloc (sizeof (unsigned int)) + 4);
+ MR_tempr3 = ((unsigned int *) MR_mr0)[0];
+
+ ((unsigned int *) (MR_tempr1 - 4))[0] = MR_tempr3;
+
+ MR_tempr2 = (unsigned int)((char *) malloc (2 * sizeof (unsigned int)));
+
+ ((unsigned int *) MR_tempr2)[1] = MR_tempr1;
+}