1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-options "-O1 -mvsx -mdejagnu-cpu=power7 -mlong-double-128" } */
5 
6 /* PR 67808: LRA ICEs on simple double to long double conversion test case */
7 
8 #if defined(__LONG_DOUBLE_IEEE128__)
9 /* If long double is IEEE 128-bit, we need to use the __ibm128 type instead of
10    long double.  We can't use __ibm128 on systems that don't support IEEE
11    128-bit floating point, because the type is not enabled on those
12    systems.  */
13 #define LDOUBLE __ibm128
14 
15 #elif defined(__LONG_DOUBLE_IBM128__)
16 #define LDOUBLE long double
17 
18 #else
19 #error "long double must be either IBM 128-bit or IEEE 128-bit"
20 #endif
21 
22 void
dfoo(LDOUBLE * ldb1,double * db1)23 dfoo (LDOUBLE *ldb1, double *db1)
24 {
25   *ldb1 = *db1;
26 }
27 
28 LDOUBLE
dfoo2(double * db1)29 dfoo2 (double *db1)
30 {
31   return *db1;
32 }
33 
34 LDOUBLE
dfoo3(double x)35 dfoo3 (double x)
36 {
37   return x;
38 }
39 
40 void
ffoo(LDOUBLE * ldb1,float * db1)41 ffoo (LDOUBLE *ldb1, float *db1)
42 {
43   *ldb1 = *db1;
44 }
45 
46 LDOUBLE
ffoo2(float * db1)47 ffoo2 (float *db1)
48 {
49   return *db1;
50 }
51 
52 LDOUBLE
ffoo3(float x)53 ffoo3 (float x)
54 {
55   return x;
56 }
57 
58 /* { dg-final { scan-assembler "xxlxor" } } */
59