Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/strcpy-2.c

raw
1 /* Test to make sure strcpy works correctly. */
2 #define STRING "Hi!THE"
3
4 const char a[] = STRING;
5
6 void f(char *a) __attribute__((noinline));
7 void f(char *a)
8 {
9 __builtin_strcpy (a, STRING);
10 }
11
12
13 int main(void)
14 {
15 int i;
16 char b[sizeof(a)] = {};
17 f(b);
18 for(i = 0; i < sizeof(b); i++)
19 {
20 if (a[i] != b[i])
21 __builtin_abort ();
22 }
23 return 0;
24 }