[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr67789.c
blob05d01ef20d777baa3530f23e021a03dce1ec890c
1 /* { dg-do assemble } */
2 /* { dg-require-effective-target fpic } */
3 /* { dg-options "-O2 -msecure-plt -fPIC" } */
4 /* { dg-skip-if "" { powerpc*-*-darwin* powerpc-ibm-aix* } } */
6 #define FE_TONEAREST 0
7 #define FE_UPWARD 1
8 #define FE_DOWNWARD 2
9 #define FE_TOWARDZERO 3
11 extern int fesetround(int);
13 void
14 set_fpu_rounding_mode (int mode)
16 int rnd_mode;
18 switch (mode)
20 case 2:
21 rnd_mode = FE_TONEAREST;
22 break;
24 case 4:
25 rnd_mode = FE_UPWARD;
26 break;
28 case 1:
29 rnd_mode = FE_DOWNWARD;
30 break;
32 case 3:
33 rnd_mode = FE_TOWARDZERO;
34 break;
36 default:
37 return;
40 fesetround (rnd_mode);