blob: eedcb6a31736a9a6e21e1fe1e97ef7123293e84b (
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
|
/* PR target/21297 */
typedef __SIZE_TYPE__ size_t;
extern int memcmp (const char *, const char *, size_t);
extern void abort ();
void
foo (char *x)
{
int i;
for (i = 0; i < 2; i++);
x[i + i] = '\0';
}
void
bar (char *x)
{
int i;
for (i = 0; i < 2; i++);
x[i + i + i + i] = '\0';
}
int
main (void)
{
char x[] = "IJKLMNOPQR";
foo (x);
if (memcmp (x, "IJKL\0NOPQR", sizeof x) != 0)
abort ();
x[4] = 'M';
bar (x);
if (memcmp (x, "IJKLMNOP\0R", sizeof x) != 0)
abort ();
return 0;
}
|