comparison gcc/testsuite/gcc.c-torture/execute/pr86528.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* PR middle-end/86528 */
2
3 void __attribute__((noinline, noclone))
4 test(char *data, __SIZE_TYPE__ len)
5 {
6 static char const appended[] = "/./";
7 char *buf = __builtin_alloca (len + sizeof appended);
8 __builtin_memcpy (buf, data, len);
9 __builtin_strcpy (buf + len, &appended[data[len - 1] == '/']);
10 if (__builtin_strcmp(buf, "test1234/./"))
11 __builtin_abort();
12 }
13
14 int
15 main()
16 {
17 char *arg = "test1234/";
18 test(arg, __builtin_strlen(arg));
19 return 0;
20 }