modula2 testsuite: new libc unit test
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr39678.C
bloba7c120ad4db76477e4c1b375a6f24e5ed0de2ca4
1 /* PR target/39678 */
2 /* { dg-do run } */
3 /* { dg-options "-Wno-psabi" } */
4 struct Y {};
5 struct X {
6   struct Y y;
7   __complex__ float val;
8 };
10 struct X __attribute__((noinline))
11 foo (float *p)
13   struct X x;
14   __real x.val = p[0];
15   __imag x.val = p[1];
16   return x;
18 extern "C" void abort (void);
19 float a[2] = { 3., -2. };
20 int main()
22   struct X x = foo(a);
23   if (__real x.val != 3. || __imag x.val != -2.)
24     abort ();
25   return 0;