OSDN Git Service

2007-05-22 H.J. Lu <hongjiu.lu@intel.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.target / i386 / movsi-sm-1.c
1 /* { dg-do run } */
2 /* { dg-options "-O2 -fgcse-sm -minline-all-stringops" } */
3
4 /* Store motion used to fail to recognize killed expressions within
5    parallels such as those generated for memory copying.  */
6
7 static const char s[1024] __attribute__ ((__aligned__ (32)))
8   = "This is what we should get!";
9
10 int bug (int arg) {
11   char str[sizeof(s) > 4 ? sizeof(s) : 4] __attribute__ ((__aligned__ (32)));
12
13   __builtin_memcpy (str, "Bug", 4);
14
15   if (arg <= 2)
16     __builtin_memcpy (str, s, sizeof (s));
17
18   if (arg <= 1)
19     __builtin_memcpy (str, "Err", 4);
20
21   __builtin_puts (str);
22
23   return str[0] != s[0];
24 }
25
26 int main () {
27   if (bug (2))
28     __builtin_abort ();
29
30   return 0;
31 }