| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 3 |
|
| 4 |
__attribute__ ((noinline)) int |
| 5 |
f1 (void) |
| 6 |
{ |
| 7 |
char *s0= "abcd"; |
| 8 |
char s[8]; |
| 9 |
__builtin_strcpy (s, s0); |
| 10 |
return __builtin_strcmp (s, "abc") != 0; |
| 11 |
} |
| 12 |
|
| 13 |
__attribute__ ((noinline)) int |
| 14 |
f2 (void) |
| 15 |
{ |
| 16 |
char *s0 = "ab"; |
| 17 |
char s[8]; |
| 18 |
__builtin_strcpy (s, s0); |
| 19 |
return __builtin_strcmp ("abc", s) != 0; |
| 20 |
} |
| 21 |
|
| 22 |
int main (void) |
| 23 |
{ |
| 24 |
if (f1 () != 1 |
| 25 |
|| f2 () != 1) |
| 26 |
__builtin_abort (); |
| 27 |
|
| 28 |
return 0; |
| 29 |
} |
| 30 |
|
| 31 |
/* { dg-final { scan-tree-dump-times "strcmp" 0 "optimized" } } */ |