OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pr44404.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* 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".  */
4
 
5
/* { dg-do run } */
6
/* { dg-options "-O2 -fno-unroll-loops" } */
7
 
8
extern char *strcpy (char *, const char *);
9
extern int strcmp (const char*, const char*);
10
extern void abort (void);
11
 
12
char buf[128];
13
 
14
void __attribute__((noinline))
15
bar (int a, const char *p)
16
{
17
  if (strcmp (p, "0123456789abcdefghijklmnopqrstuvwxyz") != 0)
18
    abort ();
19
}
20
 
21
void __attribute__((noinline))
22
foo (int a)
23
{
24
  if (a)
25
    bar (0, buf);
26
  strcpy (buf, "0123456789abcdefghijklmnopqrstuvwxyz");
27
  bar (0, buf);
28
}
29
 
30
int
31
main (void)
32
{
33
  foo (0);
34
  return 0;
35
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.