libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / memcmp-pr95189.c
blobd8250ecfc9879ef85cec2c8392c70347791f46be
1 /* PR middle-end/95189 - memcmp being wrongly stripped like strcmp
2 { dg-do run }
3 { dg-options "-O2 -Wall" } */
5 char a4[] = "\0abc";
6 char a8[] = "\0abcdefg";
7 char a16[] = "\0abcdefghijklmno";
9 int cmp4 (void)
11 return __builtin_memcmp (a4, "\0\0\0\0", 4);
14 int cmp8 (void)
16 return __builtin_memcmp (a8, "\0\0\0\0\0\0\0\0", 8);
19 int cmp16 (void)
21 return __builtin_memcmp (a16, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16);
24 int main (void)
26 if (cmp4 () < 1 || cmp8 () < 1 || cmp16 () < 1)
27 __builtin_abort ();