libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / pr100680.c
blob4b5ffc6565f3819795715638fe17311b6c6156f5
1 /* PR middle-end/100680 */
2 /* { dg-do compile { target size32plus } } */
3 /* { dg-options "-O2 -Wstringop-overread" } */
5 struct s {
6 char a[8];
7 int i;
8 long l;
9 };
11 extern char ea[8];
12 static char sa[8] = { 1, 2, 3, 4 };
14 int
15 test (void)
17 const struct s *ps = (const struct s *) 0x12345678L;
18 if (__builtin_memcmp (ps->a, ps->a, 8))
19 return 0;
21 if (__builtin_memcmp (ps->a, ea, 8)) /* { dg-bogus "exceeds source size 0" } */
22 return 0;
24 if (__builtin_memcmp (ps->a, sa, 8)) /* { dg-bogus "exceeds source size 0" } */
25 return 0;
27 if (__builtin_memcmp (ps->a, "abcdABCD", 8)) /* { dg-bogus "exceeds source size 0" } */
28 return 0;
30 return 1;