summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/960327-1.c
blob: bc82cb5dacf632509c760a6afba9d1e87b782e98 (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
#include <stdio.h>
g ()
{
  return '\n';
}

f ()
{
  char s[] = "abcedfg012345";
  char *sp = s + 12;

  switch (g ())
    {
      case '\n':
        break;
    }

  while (*--sp == '0')
    ;
  sprintf (sp + 1, "X");

  if (s[12] != 'X')
    abort ();
}

main ()
{
  f ();
  exit (0);
}