Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.c-torture/compile/pr42049.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* PR middle-end/42049 */ |
2 | |
3 extern char *strcpy (char *s1, const char *s2); | |
4 struct S { char s[4]; }; | |
5 | |
6 int | |
7 foo (int x, char **y) | |
8 { | |
9 char const *a; | |
10 char const *b; | |
11 struct S s[9]; | |
12 long i; | |
13 if (x > 1) | |
14 a = y[1]; | |
15 else | |
16 a = "abc"; | |
17 if (x > 2) | |
18 b = y[2]; | |
19 else | |
20 b = "def"; | |
21 strcpy (s[0].s, a); | |
22 strcpy (s[1].s, b); | |
23 for (i = 2; i < x - 2 && i < 8; i++) | |
24 strcpy (s[i].s, y[i + 1]); | |
25 s[i].s[0] = '\0'; | |
26 return 0; | |
27 } |