Handle peeling for alignment with masking
[official-gcc.git] / gcc / testsuite / gcc.dg / pr44404.c
bloba0b4ceb98ca8a269fdb1d7e9e74ab438e45e6257
1 /* PR rtl-optimization/44404
2 foo() used to be miscompiled on ARM due to a bug in auto-inc-dec.c,
3 which resulted in "strb r1, [r1], #-36". */
5 /* { dg-do run } */
6 /* { dg-options "-O2 -fno-unroll-loops" } */
8 extern char *strcpy (char *, const char *);
9 extern int strcmp (const char*, const char*);
10 extern void abort (void);
12 char buf[128];
14 void __attribute__((noinline))
15 bar (int a, const char *p)
17 if (strcmp (p, "0123456789abcdefghijklmnopqrstuvwxyz") != 0)
18 abort ();
21 void __attribute__((noinline))
22 foo (int a)
24 if (a)
25 bar (0, buf);
26 strcpy (buf, "0123456789abcdefghijklmnopqrstuvwxyz");
27 bar (0, buf);
30 int
31 main (void)
33 foo (0);
34 return 0;