| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-profiling "-fprofile-generate" } */ |
| 3 |
/* { dg-additional-options "-fprofile-generate" } */ |
| 4 |
|
| 5 |
extern int isspace (int); |
| 6 |
|
| 7 |
int foo(const char *txt, char *buf) |
| 8 |
{ |
| 9 |
const char *s; |
| 10 |
char *d; |
| 11 |
int ws = 1; |
| 12 |
for (s=txt, d=buf; *s; ) |
| 13 |
{ |
| 14 |
if (*s=='/' && *(s+1)=='/') { |
| 15 |
|
| 16 |
s += 2; |
| 17 |
while (*s && *s!='\r' && *s!='\n') |
| 18 |
s++; |
| 19 |
} |
| 20 |
else if (*s=='"') { |
| 21 |
|
| 22 |
s++; |
| 23 |
while (*s && *s!='\r' && *s!='\n' && *s!='"') |
| 24 |
if (*s++=='\\') |
| 25 |
s++; |
| 26 |
if (*s=='"') |
| 27 |
s++; |
| 28 |
} |
| 29 |
else { |
| 30 |
if (*s && !isspace(*s)) |
| 31 |
ws = 0; |
| 32 |
|
| 33 |
|
| 34 |
*d++ = *s++; |
| 35 |
|
| 36 |
} |
| 37 |
} |
| 38 |
*d = '\0'; |
| 39 |
|
| 40 |
return ws; |
| 41 |
} |
| 42 |
|
| 43 |
/* { dg-final { scan-tree-dump "base object not addressable" "slp1" } } */ |
| 44 |
/* { dg-final { scan-tree-dump-not "MEM\[^\r\n\]*__gcov\[^\r\n\]* = vect_cst" "slp1" } } */ |