libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / strcmpopt_11.c
blob945e08319968cbfd2bee8e6ad7aea73153b948f9
1 /* Verify that strcmp doesn't make assumptions about the size of a weak
2 symbol.
3 { dg-do compile }
4 { dg-options "-O2 -Wall" } */
6 /* An ordinary definition of A with more elements might be provided
7 in another translation unit. Even though that would be undefined
8 (the type of the actual definition must be the same as the type
9 of the weak declaration) this test verifies that GCC doesn't rely
10 on the size of this A for optimization (as a matter of QoI). */
11 __attribute__ ((weak)) char a[3];
13 int cmp_a3_x (void)
15 return __builtin_strcmp (a, "1234567") == 0;