libstdc++: Fix -Wsign-compare warning in std::string::resize_for_overwrite
[official-gcc.git] / gcc / testsuite / gcc.dg / pr114605.c
blob4b5c9c1c0a09d1b96519b649358d8e35cbf6cd8f
1 /* PR target/114605 */
2 /* { dg-do run } */
3 /* { dg-options "-O0" } */
5 typedef struct { const float *a; int b, c; float *d; } S;
7 __attribute__((noipa)) void
8 bar (void)
12 __attribute__((noinline, optimize (2))) static void
13 foo (S *e)
15 const float *f;
16 float *g;
17 float h[4] = { 0.0, 0.0, 1.0, 1.0 };
18 if (!e->b)
19 f = h;
20 else
21 f = e->a;
22 g = &e->d[0];
23 __builtin_memcpy (g, f, sizeof (float) * 4);
24 bar ();
25 if (!e->b)
26 if (g[0] != 0.0 || g[1] != 0.0 || g[2] != 1.0 || g[3] != 1.0)
27 __builtin_abort ();
30 int
31 main ()
33 float d[4];
34 S e = { .d = d };
35 foo (&e);
36 return 0;