aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr39423-1.c
blob: 34ebb66381a158e6b754ae4da4efa932fb853831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* PR target/39423 */

int
foo (const char *name, int nmlen, char *flags)
{
  const char *nonspc;
  int len, n, lfn;
  int needlfn[2], dotspc[2];
  unsigned char locale[2];
  for (nonspc = &name[nmlen - 1]; nonspc >= name && *nonspc == ' '; ++n)
    {
      if (!nmlen)
	{
	  needlfn[name >= nonspc] = !0, dotspc[n != 0] =
	    locale[0], --n, name += len, nmlen -= len;
	}
    }
  if (!lfn && ((dotspc[0] == ' ' && !(len & 0x0010)) || dotspc[0] == '.'))
    return 22;
  if (!(needlfn[0] || needlfn[1]))
    *flags |= 0x02;
}