summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/20030414-1.c
blob: 9ba595318dcac5742f9f3f117de9630285ab6ec1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* PR target/10377
   Distilled by Hans-Peter Nilsson <hp@axis.com> from ncurses-5.3 infocmp.c.
   Copyright (C) 2003 Free Software Foundation.  */

/* { dg-do assemble } */
/* { dg-options "-O2 -fPIC" { target *-*-*gnu* } } */

extern int f2 (char *, char *);
extern char *ss[];
extern char *cc;
void
f1 (char *dd, char *bb)
{
  char *sp = bb + 1;
  char *ap;
  int i;
  char *ee = 0;
  char *cp;

  for (i = 0, cp = cc; i < 42; i++)
    if (cp)
      {
	if (f2 (dd, "xx") || f2 (ss[i], "xx") || f2 (ss[i], "yy"))
	  if (bb < cp)
	    continue;
	ee = ss[i];
	break;
      }

  if (!ee)
    for (ap = cc; *ap; ap++)
      if (f2(ap, sp))
	{
	  ee = ap;
	  break;
	}

  cc = ee;
}
OpenPOWER on IntegriCloud